Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

how to fire ItemStateChanged event

Thread view: 
Wizumwalt@gmail.com - 17 Oct 2005 15:59 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.

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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.