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.
Vova Reznik - 17 Oct 2005 17:19 GMT
> 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.
Roedy Green - 17 Oct 2005 22:34 GMT
>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

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.