I'm using a free design in my project and dragging into my jframe the components I want. However, I needed to use a jComboBox with autocomplete and I was guided by this site. Now I wanted to use the class 'AutocompleteJComboBox' and apply it to a jCombobox that I dragged into my frame. Is this possible?
I have tried to put this part of the code in the constructor:
List<String> myWords = new ArrayList<>();
myWords.add("bike");
myWords.add("car");
myWords.add("cap");
myWords.add("cape");
myWords.add("canadian");
myWords.add("caprecious");
myWords.add("catepult");
StringSearchable searchable = new StringSearchable(myWords);
AutocompleteJComboBox combo = new AutocompleteJComboBox(searchable);
//combo.setBounds(600, 200, 100, 25);
jPanel3.add(combo);
The point is that I did not want to be using the setBounds method because it's complicated to be looking for the best position and size for the jComboBox. If you do not use this method, the combo does not appear in my jPanel.
Any suggestions on how to apply this autocomplete to a jComboBox that I dragged to my jFrame?