Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2007

Tip: Looking for answers? Try searching our database.

set Title on JTabbedPane when Combobox selection is made

Thread view: 
Jack - 19 Jul 2007 20:49 GMT
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");


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.