The Artima Developer Community
Sponsored Link

Java Answers Forum
JComboBox Listener problem

1 reply on 1 page. Most recent reply: Jun 15, 2009 2:49 AM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Jangli Bujulannagari

Posts: 1
Nickname: bmlbjs
Registered: Jun, 2009

JComboBox Listener problem Posted: Jun 12, 2009 2:45 AM
Reply to this message Reply
Advertisement
While design, i am getting some problem related to JComboBox Listener.

In my class i have defined two combo box objects and in the fisrt combo box there are some values populating.
When i select the item from first comboo box the corresponding value to the item selected are populating in the second combo box.
However when selected the item in the second combo box the necessary action is not performing.

When i select the item in the first combo box, the action which needs to perform in case of item selection of second combo box is performing along with the action needs to perform for the item selected in the first combo box.

I have added actionListener for the two combo boxes and doing implemented the action performed method.

Please help me to resolve the issue.


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: JComboBox Listener problem Posted: Jun 15, 2009 2:49 AM
Reply to this message Reply
Do you have example Code?

If you have added the ActionListeners properly everything should just work.

comboBox1.addActionListener(new AbstractAction(){
    public void actionPerformed(ActionEvent evt) {
        //  do stuff - perhaps use JOPtionPane to help debug
    }
});
 
comboBox2.addActionListener(new AbstractAction(){
    public void actionPerformed(ActionEvent evt) {
        //  do stuff - debug with JOptionPane also
    }
});


Please post your example code.

Flat View: This topic has 1 reply on 1 page
Topic: circular buttons Previous Topic   Next Topic Topic: My Project

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use