Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/com/CDPrintable/ProgramWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ public void mouseClicked(MouseEvent e) {
// CD Search Panel set up
cdSearchPanel.setBorder(BorderFactory.createTitledBorder("Search"));

// Make the input field
JTextField searchField = new JTextField(15);

// Search type combo box set up
JComboBox<String> searchTypeComboBox = new JComboBox<>(new String[] {"CDStub", "Artist", "Release"});

// Search button and event listener setup
JButton searchButton = new JButton("Search");

searchButton.addActionListener(_ -> {
if (searchTypeComboBox.getSelectedItem() == null) {
return;
Expand Down Expand Up @@ -175,6 +178,9 @@ public void mouseClicked(MouseEvent e) {
});
});

// Set up enter key and text box
searchField.addActionListener(_ -> searchButton.doClick());

cdSearchPanel.setLayout(new FlowLayout());
cdSearchPanel.add(searchTypeComboBox);
cdSearchPanel.add(searchField);
Expand Down