Action Event handling when using JTabbedPanes

Hello,

I'm running into a slight, wouldn't say issue, but rather a lack of foresight when using JTabbedPanes.

I have created a JTabbedPane with two separate panels. Both are customized extentions of JPanel. In essence, pane 1 is reading data from a file and populating a series of fields, comboboxs, etc. Pane 2 is just a visual representation of the same data in tree format.

The issue comes into play when I update the data in the first pane. Is there some sort of event I can trigger in order to tell the second pane to update?

Thanks in advance for any help.

[596 byte] By [niemczkja] at [2007-10-3 5:15:09]
# 1

myJTabbedPane.addChangeListener(new ChangeListener() {

// This method is called whenever the selected tab changes

public void stateChanged(ChangeEvent evt) {

JTabbedPane pane = (JTabbedPane)evt.getSource();

// Get current tab

MyClass class=(MyClass)pane.getSelectedComponent();

// do something with your class

}

});

regards,

johnarevaloa at 2007-7-14 23:21:45 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks for the help.
niemczkja at 2007-7-14 23:21:45 > top of Java-index,Desktop,Core GUI APIs...