I have a main JFrame
pane using Swing in Java with a JComboBox
embedded in it with a number of selections.
Everything initiates well on opening but when I write inside the JTextField
, the words in the JComboBox disappear.
I'm initiating my JComboBox
in in the following way:
private static String[] options = new String[] {"Search your own pasted text" , "Search your own file",
"Search website", "Search Lyric Database", "Search Books Database"};
private static JComboBox<String> bookList = new JComboBox<>(options);
Then I initiate the JTextField in this way
private static JTextField textFieldTheme = new JTextField(50);
private static String theme = textFieldTheme.getText();
Have no idea why they interfere with each other....everything works fine still. In fact, I can stick click the the JComboBox
menu, its just that it resizes and the words disappear from it