Home arrow static arrow Java Programming [Archive] - JTabbedPane ChangeEvent
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - JTabbedPane ChangeEvent
This topic has 1 reply on 1 page.

Posts:71
Registered: 9/29/03
JTabbedPane ChangeEvent  
Jul 28, 2004 11:27 AM



 
I have successfully implements a state_changed method to handle clicking on the tabs in my JTabbedPane. However, I notice that the state_changed method not only gets called when I click on a tab, but also when I dynamically create a new tab. This is something that I do NOT want.

How can I prevent this or distinguish between the two actions?

Thanks ahead of time
 

Posts:18,384
Registered: 21.03.00
Re: JTabbedPane ChangeEvent  
Jul 28, 2004 12:19 PM (reply 1 of 1)



 
Hi,

One way is to remove the listener when you create a new tab, and then add it again.

/Kaj
 
This topic has 1 reply on 1 page.