Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to fire ItemStateChanged event

Reply
Thread Tools

how to fire ItemStateChanged event

 
 
Wizumwalt@gmail.com
Guest
Posts: n/a
 
      10-17-2005
Is there anyway for me to programatically fire an ItemStateChanged
ItemEvent on a class w/ ItemListener? Basically, I need to select a
certain tab from my JTabbedPane when my actionPerformed() method from a
JTree is selected.

Any help much appreciated.

 
Reply With Quote
 
 
 
 
Vova Reznik
Guest
Posts: n/a
 
      10-17-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Is there anyway for me to programatically fire an ItemStateChanged
> ItemEvent on a class w/ ItemListener? Basically, I need to select a
> certain tab from my JTabbedPane when my actionPerformed() method from a


Why not just yourTabbedPane.setSelectedIndex(int index);
?
> JTree is selected.
>
> Any help much appreciated.
>

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-17-2005
On 17 Oct 2005 07:59:00 -0700, "(E-Mail Removed)"
<(E-Mail Removed)> wrote or quoted :

>Is there anyway for me to programatically fire an ItemStateChanged
>ItemEvent on a class w/ ItemListener? Basically, I need to select a
>certain tab from my JTabbedPane when my actionPerformed() method from a
>JTree is selected.


The easiest way is to call the method with a fake Event.

The next easiest way is to construct a synthetic event and add it to
the queue. see http://mindprod.com/jgloss/events11.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ImageButton event doesn't fire but Button event does suzanne.boyle@gmail.com ASP .Net 4 06-13-2007 09:19 PM
load event doesn't fire unless init event is present Andy Fish ASP .Net Web Controls 2 07-07-2005 06:16 PM
Fire server side event before client side event ASP .Net Web Controls 3 03-18-2005 03:20 PM
onmousedown event causing body onload event to fire Bender Javascript 2 10-22-2003 10:29 PM
JComboBox itemStateChanged in 1.3 and 1.4 Manoj Nair Java 0 09-12-2003 04:38 AM



Advertisments