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 JTabbedPane - Tab Reordering 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 "JTabbedPane - Tab Reordering" Watch "JTabbedPane - Tab Reordering" New topic

JTabbedPane - Tab Reordering

Krysty Sullivan
Ranch Hand

Joined: Jun 06, 2002
Posts: 48
Can a Tab in JTabbedPane be dragged and dropped to reorder/rearrange Tabs?
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
Hi there

I looked into this a while ago. Unfortunatly JTabbedPane doesn't support this and we couldn't find any good ready made components to suit our needs.

In the end we wrote a custom component that listens for mouse clicks on the tab and then waits for the mouse released action to reorder the tabs.

Krysty Sullivan
Ranch Hand

Joined: Jun 06, 2002
Posts: 48
Hi Rachel!

Thanks for replying. I also wrote a custom component to listen to mouse press/drag and release but I couldn't seem to copy/move the content of the tab I'm trying to drag and drop (I made use of TransferHandler). May I know what you used to drag and drop the tab content itself? Thanks in advance.
I agree. Here's the link:
subject: JTabbedPane - Tab Reordering
Similar Threads
How to place the Tab in JTabbedPane on the right hand side of the tabbedpane
retrieving values from JTabbedPane
Getting the size of a tab in a JTabbedPane
How do I create a JTabbedPane with editable tab labels
Adding java programs into JFrame