J
Joe
User clicks on a tabbed pane of several. I've subclassed
DefaultSingleSelectionModel so that I can display a dialog window
before the chosen tabbedpane is actually displayed. My dialog is
displayed from within the setSelectedIndex() method of my subclass.
My problem is that I want to filter events so that I only display this
dialog when it comes from clicking on a tabbed pane and not a JTree
node (which is what is currently happening).
---
tabbedPaneListener = new TabbedPaneListener(this);
tabbedPane = new JTabbedPane();
tabbedPane.addTab("tab", mypanel);
SingleSelectionModel tabModel = new TabbedSelectionModel(this);
tabbedPane.setModel(tabModel);
tabbedPane.addChangeListener(tabbedPaneListener);
---
For some reason, clicking on a JTree node also sends the same event as
a tabbed pane and I need to filter between the two.
Also, the TabbedPaneListener (where I could get the event source),
comes after the point that I need the source type which is in
setSelectedIndex(). So first setSelectedIndex() gets called, then the
stateChanged() from the listener gets called, and I need the source
type inside the setSelectedIndex().
Anyone have ideas?
DefaultSingleSelectionModel so that I can display a dialog window
before the chosen tabbedpane is actually displayed. My dialog is
displayed from within the setSelectedIndex() method of my subclass.
My problem is that I want to filter events so that I only display this
dialog when it comes from clicking on a tabbed pane and not a JTree
node (which is what is currently happening).
---
tabbedPaneListener = new TabbedPaneListener(this);
tabbedPane = new JTabbedPane();
tabbedPane.addTab("tab", mypanel);
SingleSelectionModel tabModel = new TabbedSelectionModel(this);
tabbedPane.setModel(tabModel);
tabbedPane.addChangeListener(tabbedPaneListener);
---
For some reason, clicking on a JTree node also sends the same event as
a tabbed pane and I need to filter between the two.
Also, the TabbedPaneListener (where I could get the event source),
comes after the point that I need the source type which is in
setSelectedIndex(). So first setSelectedIndex() gets called, then the
stateChanged() from the listener gets called, and I need the source
type inside the setSelectedIndex().
Anyone have ideas?