Element « JComboBox « Java Swing Q&A





1. How to configure JComboBox not to select FIRST element when created? (Java)    stackoverflow.com

Problem: Update: From the Java SE 6 API:

public JComboBox() Creates a JComboBox with a default data model. The default data model is an empty list of objects. Use ...

2. How to use Map element as text of a JComboBox    stackoverflow.com

I am populating a JComboBox (using addItem()) with all the elements of a collection. Each element in the collection is a HashMap (so its a ComboBox of Hashmaps..). My question is ...

3. How can I refresh a JScrollPane after choosing an element from a JComboBox?    stackoverflow.com

I have a JComboBox, and I want to load in a JScrollPane a different content everytime I choose a different element from the JComboBox. The content consists of a various number ...

4. Persistent state for Java UI elements between runs    stackoverflow.com

I have a Java program which has a number options it allows the user to change, mostly via JComboBox. The only problem is that every time the user closes the program ...

5. Java: Do something via a JButton with an Element of a JComboBox    stackoverflow.com

I need to find a resolution for connecting a JComboBox with a JButton. Means do "Button" with selected Item in JComboBox. I created a Controller for that public class DeleteButtonController implements ActionListener{ ...

6. Editing JComboBox elements!    coderanch.com

8. hiding elements in jcombobox    coderanch.com

9. Arrow navigation not working on JComboBox with null element    coderanch.com

I just figured this one out a couple weeks ago after not finding a solution online. The problem is in JComboBox's getSelectedIndex method. There's a check there that if the selected value is null, it is hardcoded to return -1 as the index (rather than 0 if it were the first item in your combo box). The UI uses the selected ...