S
Scott Steiner
Hi,
I would like to identify which tab of my JTabbedPane has been selected.
Currently I know of 2 methods:
a) by getSelectedIndex()
i = myTabbedPane.getSelectedIndex()
if (i == 0) ...
b) by getTitleAt()
tabTitle = myTabbedPane.getTitleAt(myTabbedPane.getSelectedIndex())
if (tabTitle.equals(...))
I can't use getSelectedIndex() because my TabbedPane is dynamic and the
index can change. Hence I use the getTitleAt() method. It seems to me a
little strange though to identify a tab by its string title. Is there no
way one can assign a sort of unique ID to a tab which I can query?
Thanks in advance.
I would like to identify which tab of my JTabbedPane has been selected.
Currently I know of 2 methods:
a) by getSelectedIndex()
i = myTabbedPane.getSelectedIndex()
if (i == 0) ...
b) by getTitleAt()
tabTitle = myTabbedPane.getTitleAt(myTabbedPane.getSelectedIndex())
if (tabTitle.equals(...))
I can't use getSelectedIndex() because my TabbedPane is dynamic and the
index can change. Hence I use the getTitleAt() method. It seems to me a
little strange though to identify a tab by its string title. Is there no
way one can assign a sort of unique ID to a tab which I can query?
Thanks in advance.