Event « JComboBox « Java Swing Q&A





1. Swing: Is there a way to differentiate between a user-caused ItemEvent and an application-caused one?    stackoverflow.com

I'm working with a combobox in a Swing-based application, and I'm having a hard time figuring out what to do to differentiate between an ItemEvent that is generated from a user ...

2. Java - Why do component functions call actionPerformed?    stackoverflow.com

In my code, two comboboxes are added to actionListener( this ); In another part of my code, I call a combobox function that sets an index to a certain value. This in ...

3. JFrame not working correctly    stackoverflow.com

This is making me very angry, I have worked on this for 2 days, have 2 books open and have looked through them, and STILL can't get this program to run ...

4. itemlistener gets event after focus is removed from jcombobox    stackoverflow.com

This must be a misunderstanding from my side, but I have the following:
I have added an ItemListener to a Jcombobox.
In the item listener, I check in the event if it is ...

5. ActionListener differences between Windows and Linux    stackoverflow.com

I have a JComboBox. I add a ActionListener using the following code:


addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
  ...

6. How to identify the source of an event..?    stackoverflow.com

Does the method JComboBox.removeAllItems() in turn fire an ItemStateChanged event..?
If so, how do i determine weather the event is generated due to the user action or due to the invocation of ...

7. Actionperformed not triggered for JComboBox    stackoverflow.com

I have an ActionListener attached to a JComboBox(uneditable). Once an item from the JComboBox is selected, I have to make the next button in the frame visible. The skeleton of the code ...

8. Java Swing and JComboBox Events    stackoverflow.com

I have a JComboBox with multiple values in it. I need to be able to detect when the user clicks the JComboBox but does not change the currently selected item. Neither itemStateChanged ...

9. Help implementing JComboBox[] Listener    stackoverflow.com

1) In the following method (actionListener) a user select a grade (e.g. A-F) from a JComboBox. 2) There are multiple JComboBoxes, and each selection made gets stored into a single String[] array. ...





10. NullPointerException when accessing another class in ActionListener    stackoverflow.com

I am trying to add an ActionListener to a JButton in the standard way: outside of the method I have private Actions listener;and inside of the method I have put

listener ...

11. GRADING SYSTEM using JComboBox for the entry of grades; Jlabel, JTextFirld,JFrame; JButton for events; all in JFrame    stackoverflow.com

here is my code for our finals. a grading system were the grades are all in 24 JComboBox. some with numbers till 10, 20 and 30. each quarter they are computed ...

12. JComboBox event problem with local variable    forums.netbeans.org

Hello everyone I'm quite new to java programming (was using c# until now), sorry if the question is about something stupid. I have a combo that changes it's items dynamically at runtime depending on some criteria the user can choose from, the list is reloaded from the database - so far this works fine. Now I wanted to set back the ...

13. JComboBox keyTyped event    coderanch.com

14. ActionListener on JComboBox    coderanch.com

15. JComboBox ActionListener not reacting    coderanch.com

16. JComboBox event triggers another JComboBox    coderanch.com

thanks Eric. At moment, I have Combo_A, Combo_B and List_C, and Combo A and B are using ItemListener(). When I change Combo_A, Combo_B is using removeAllItems() to remove all existing contents first then trying to add new contents. But this causes event trigger on Combo_B and Comb_B is not updated properly. Below is my basic code structue, and please revise me ...





17. jcombobox events    coderanch.com

19. JComboBox event handling question    coderanch.com

20. JComboBox event sequence    coderanch.com

21. JComboBox event order.    coderanch.com

I'm having a little trouble with a JComboBox. Essentially I want to use it for a Yes/No situation (Within the GUI it's neater than a set of radio buttons), but I want the user to confirm the "Yes" option via a dialog box (as setting this option could be damaging). Using either ActionPerformed or ItemStateChanged results in a dialog box popping ...

22. JComboBox ActionListener and Swing Thread safety    java-forums.org

I am developing an application that among other things has two JComboBoxes. It is convenient that both combo boxes has the same action listener. Basically at the most upper level I want to create a JFrame class which will contain all the GUI elements, data storage class which will contain internal data needed for application to run, data access class which ...

23. Combo Box Event handling    java-forums.org

i am using two combo boxes and in first combo box i have Undergraduate program names and second one have Semester no. when i m clicking and selecting first combo box value , i m getting respective no of semester from array list and inserting into second combo by calling construtor. but the problem is that my second combo box is ...

24. Question on ActionListener in combo box    java-forums.org

I tried to have one button to click to set the combo box to a certain selected option...means when the new button is clicked it'll empty all texfields (worked out) and return the combo box to a default selected item. Java Code: public class MatModule extends JFrame { private static final long serialVersionUID = -5505615683022863857L; public JComboBox cboUnitID; public MatModule() throws ...

25. JComboBox ActionListeners    forums.oracle.com

Hi to all! I have a JComboBox with an ActionListener and everytime I want to reset the selected item of the jcombobox, it performs the events in the actionlistener. I tried both setSelectedIndex(-1) and seSelectedItem(null) but both of them still perform the events. Is there any way for me to reset the value of my JComboBox to null without performing the ...

26. JComboBox - Event Name...    forums.oracle.com