Listening for tab removal in JTabbedPane

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • meLlamanJefe
    New Member
    • Mar 2008
    • 29

    Listening for tab removal in JTabbedPane

    My application uses 2 tabbed panes to display data (one has a table, the other has graphs). I have them synchronized so that when the user selects a tab in either pane the corresponding tab is automatically selected in the other pane thus keeping the tables and the graphs together in the user interface.

    The problem I have not been able to solve is to apply the same concept when the user closes a tab in either pane. Otherwise, if the user closes(removes) a tab in the data table pane, the system should automatically remove the corresponding graph tab in the plots pane.

    I have tried looking at the changeEvent but this does not tell me what the event that fired it was (either add, select, or remove). Has anyone done or tried this before with success?

    Thanks.
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Greetings!

    Couldn't you write a statement for it? Just seems to be the simplest since it's just two tabs...

    In a bit!

    Comment

    Working...