Select « JComboBox « Java Swing Q&A





1. UISpec4J: Returning a Trigger from a Combobox selection?    stackoverflow.com

This question is for the UISpec4J testing framework, for testing Java GUIs... I'm trying to test an error message pop-up window (modal) that results from making a selection from a ...

2. How to get JComboBoxes that are high enough for touchscreen selection    stackoverflow.com

I have a touchscreen interface that I have adjusted the tab, button, and scrollsize but I am uncertain if it is possible to make JComboBox easier to select individual items. Is ...

3. JPanel not refreshing upon selection with JComboBox    stackoverflow.com

I am attempting to write a pretty short class that "ties" a JPanel to a JComboBox. I think I have the logic down, but nothing happens when I select something ...

4. Getting the selected object position of a JComboBox    stackoverflow.com

I'm trying to get the position (as a int) of a JComboBox object, The ComboBox is generated and haves an action listener like this

for (int d=0; d<i; d++)
    ...

5. java swing combo box selection and link to other combo boxes    stackoverflow.com

Here is the scenario: I have a table in database with 3 columns (id, name, age). I've created 3 swing comboboxes and a button that sends a "select statement" to the ...

6. Opening new frame based on JComboBox selection    stackoverflow.com

I am a newbie to Java. I am doing a project on JavaSwing in college. I want the functionality like when i select the item in the JComboBox it should display a ...

7. [platform-dev] Setting selected index clobbers accessible context in JComboBox    forums.netbeans.org

Hi (again) folks, I have a JComboBox object that I've placed on an options pane form. This system connects to whatever operating system you are on, asks for any text to ...

8. Make panes in jFrame tha disappear or appear by the selection of jComboBox    forums.netbeans.org

Hello everybody I have a problem and i would really appreciate your help I use netbeans ide 6.7.1 and I have a jFrame that contains a jPanel. I want to add ...

9. Finding out what is selected in a JComboBox    forums.netbeans.org

I'm trying to find out is it possible to find out what has been selected in a JCombobox, whether it be the string itself or the int value of the selection. Cheers Nick





10. Using jcomboboxes to select image files    forums.netbeans.org

I'm new to Java, and most of this stuff is confusing. What I'm trying to do (using the Netbeans IDE) is to select up to 4 picture files, using a dedicated combo box for each picture (the pictures are being used for separate operations so I need one combo box per picture). The first item is "..." to deselect the picture, ...

11. ComboBox highlighted selection?    coderanch.com

Can anyone tell me how to move the highlighted selection on a combobox list with the keyboard arrows. I would like to have the same behavior as the mouse gives. Moving the mouse over the different selections highlights them but does not actually select one until you click the mouse. The keyboard default behavior is very different. The selection changes with ...

12. JComboBox Selection?    coderanch.com

I have a JComboBox that contains user defined objects that contain an equals() method. When I create the combo box I add a few objects, then I try to call setSelectedItem(aObject). This does not select the item. The text in the combo box is empty. When I click on it I can see that the item I tried to select is ...

13. need help on JComboBox & Date Selection    coderanch.com

14. Combo box selection    coderanch.com





17. combobox selection    coderanch.com

Hi guys, Iam new to Listeners under Swing.Is working on a task under swing & came across the following problem. Have a comboBox(Say testCombo) filled with some string values.When the user selects one item from thge popup menu or when he presses "Enter" I want to do some action. Tried adding both the ItemListener & ActionListener to it,but then, the events ...

18. problem with user defined combobox selection    coderanch.com

Hi guys, Have an "AutoSearchComboBox" as follows for searching the combolist fast.Have some problems with the selection in the AutoSearchComboBox. public class AutoSearchComboBox extends JComboBox { /** * */ private static final long serialVersionUID = 1L; public AutoSearchComboBox(){ setEditable(true); setModel(new AutoSearchComboBoxModel()); setEditor(new MyComboBoxEditor()); } public class AutoSearchComboBoxModel extends AbstractListModel implements MutableComboBoxModel{ /** * */ private static final long serialVersionUID = 1L; ...

19. JCombo Box gives IllegalStateException while selection    coderanch.com

Originally posted by ashok rajendran: I have to stop the cell editing (Since my original application has some rules to execute on the "change value" event of the table.) when the user selects a value from the combo box. Since Java swing1.5 does not provide any api to catch the selection event (bug filed in jdk. bugid - 4199622), I am ...

20. JComboBox selection and counting arrays    coderanch.com

I have a program that allows the user to enter a value (mortgage amount) and then they use a drop down menu to choose the interest rate and the term years of the loan. i cant seem to figure out how to step to the next Array based upon the option number chosen in the drop down box. Thanks in advance ...

21. JComboBox Selected Object not visible    coderanch.com

You likely have a bug in the code that you still aren't showing us. If you are still desiring help in a forum such as this, you'll be far better off to show a small compilable program that demonstrates your problem. Otherwise I fear you'll continue to show snippets of irrelevant code.

22. How to allow 'Select none' in a JComboBox or JList    coderanch.com

Thanks Edwin for your answer. I can't figure out how to do it. This is my code: Patient[] myPatients = GestorConsultas.listarPacientes();//I get my data, from the database, in an array of Objects. jCmbPaciente.setModel(new javax.swing.DefaultComboBoxModel(myPatients)); jCmbPaciente.setSelectedIndex(-1); //The default value is NULL. But if the user selects something by mistake, then he can't selects NULL value again. How can I add the NONE ...

24. JCombo Box selection index?    java-forums.org

Hi, If I have JCombo Box with items like "ABC", "XYZ" and "ABC" at 1,2, and 3 index respectively. If I click any of them, then it is supposed to display the respective table. But if I Click "ABC" of 3rd index then combo box returns the index of first found item, and so table of 1st item. In this way, ...

25. display object corresponding to JComboBox selection    java-forums.org

Hello I am trying to make a program where there is an array of strings which is filled with text from a jtextfield and put into a combobox. There is also an array of objects which is filled with items from a jlist. When you pick a string from the jcombobox, I want it so that the corresponding objects are displayed ...

26. Select info from MS SQL Server to display in JComboBox    forums.oracle.com

public RFIDLogisticsDB getItem() { return inputSelected; } public String getR(){ return (String)itemBox.getSelectedItem(); } public void actionPerformed(ActionEvent e){ Object source=e.getSource(); } public static void main(String args[]){ String Item_ID; String Item_Status; String query = "SELECT * FROM Item WHERE Item_Status = 'warehouse'"; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:RFID Logistics"); PreparedStatement pstmt = con.prepareStatement(query); ResultSet rs= pstmt.executeQuery(); while (rs.next()) { Item_ID = rs.getString("Item_ID"); ...

27. JComboBox selection into JTextFields    forums.oracle.com

// private void initComponents() { calcButton = new javax.swing.JButton(); amortizeButton = new javax.swing.JButton(); quitButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); textAmount = new javax.swing.JTextField(); textRate = new javax.swing.JTextField(); textTermlength = new javax.swing.JTextField(); spScrollpannel = new javax.swing.JScrollPane(); taArea = new javax.swing.JTextArea(); jLabel5 = ...

28. JComboBox that should allow multiple selections using ctrl+A .    forums.oracle.com

private JPanel getContent() { // We need to keep track of the selections SelectionManager manager = new SelectionManager(); // and make the selection state available to the renderer. MultiRenderer renderer = new MultiRenderer(manager); Object[] items = { "George", "Greta", "Jenny", "Anna", "Pieter", "Antonio", "Susan", "Tom" }; manager.setNonSelectables("Greta", "Pieter"); DefaultComboBoxModel model = new DefaultComboBoxModel(items); JComboBox combo = new JComboBox(model); combo.addActionListener(manager); combo.setRenderer(renderer); JPanel ...

29. Select record from JComboBox    forums.oracle.com