I have a JTabbedPane that will have a variable number of tabs. A
JPanel is added to each tab which contains a combobox. When the
selection of the combobox is made, I'd like to set the value of the
tab title to the value selected.
tabbedPane = new JTabbedPane();
tabbedPane.setBounds(new Rectangle(6, 352, 901, 648));
comboBox = new JComboBox();
..setBounds...
comboBox.addActionListener(this);
comboBox.addItemListener(this);
I want to capture the event that the combobox changed but in the Panel
that contains the tabbedPane.
Suggestions are most appreciated.
Jack
Ray Ma - 20 Jul 2007 00:36 GMT
I guess when the users make selection on the ComboBox, you want to set
their seleted value as the title of the tab that are currently in use.
Is it can be done by:
index=JTabbedPane.getSelectedIndex();
JTabbedPane.setTitleAt(index,"some title");