As per the thread title. Setting the ComboBox to editable displays them, but allows me to mess with them. They’re also not displayed in the drop-down list. Below is a snippet showing my instantiation of the JComboBox (setEditable was there for testing).
final JComboBox<String> appPathList = new JComboBox<String>();
for(ArrayList<String> s : appPath) {
appPathList.addItem(s.get(0));
}
appPathList.setEditable(false);
So, this all works. The ComboBox populates correctly, and so on. The issue is not with my code, which is why I refrained from posting the whole class. I can do so if necessary, of course.
What do I need to change/add (be it a CellRenderer of some sort) to achieve this? And if possible, provide an example.
I’m using JDK 7.
EDIT: Was going to post images, but I need reputation.
Found it. Custom CellRenderer, if input == what I want, add an indent to the list item.
Thanks for all your help guys <3