A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
JTabbedPane listener for: add, close and change selected tab
Joined: Jun 19, 2010
Dec 21, 2010 16:42:28
What listener should I add to
, so I can "follow": opening new tab, closing tab, and changing selected tab?
The quieter you are, the more you are able to hear.
Joined: Feb 23, 2007
Dec 21, 2010 17:42:45
If you add a
(obtained via getModel()), you can listen for selection changes. I think that to listen for addition and removal of tabs / components, you'll want to add a
, though I'm not 100% sure if this is the only or best way to do this.
I agree. Here's the link:
subject: JTabbedPane listener for: add, close and change selected tab
change the focus to the new tab
How to load tab content upon clicking the tab in JTabbedPane?
show OptionDialog without JTabbedPane changing tab
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014