Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Detecting GUI event  RSS feed

 
Shrikanth Goloposwami
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've recently ran into problem regarding how to detect an event that is triggered by a user selecting a value from a JComboBox and programmically performing someJComboBox.getSelectedItem(). It seems regardless if the GUI is used or getSelectedItem() is used the event is triggered. Is there a way for one to use getSelectedItem() without an event triggering and only trigger when one uses the GUI?

Thanks!
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well do you need to use getSelectedItem over getSelectedIndex. If you have a ComboModel that is a List of some sore you can use the index returned to get the exact object that was selected from the List rather than the JComboBox. That might solve the problem and it ight noe.

Mark
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!