This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How do I create a JTabbedPane with editable tab labels Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do I create a JTabbedPane with editable tab labels" Watch "How do I create a JTabbedPane with editable tab labels" New topic
Author

How do I create a JTabbedPane with editable tab labels

Faiz Chachiya
Greenhorn

Joined: Nov 06, 2006
Posts: 6
How do I create a JTabbedPane with editable tab labels
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10171
    
    8

Originally posted by Faiz Memon:
How do I create a JTabbedPane with editable tab labels


Since 1.6 there is a method JTabbedPane#setTabComponentAt(int index,Component component)
You can use this to provide your custom component which will enable the user to edit the tab label.

If you cannot use 1.6, you might consider using a trigger (JPopupMenu on right clicking the tab perhaps), ask the user for the new text (Using the JOptionPane#showInputDialog() perhaps) and set the new title by using the JTabbedPane#setTitleAt(int index,String title)


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I create a JTabbedPane with editable tab labels
 
Similar Threads
Rearrange Tabs via Drag and Drop
JTextField problem
Swings Problem!!!!
How To increase JToolBar, make JTabbedPanes scrollable
How to Capture a Tab Click on JTabbedPane