Java JTabbedPane Drag and Drop To Window

Posted on 2007-10-08
Medium Priority
Last Modified: 2008-09-01
I'm currently running Java 1.5 on windows xp pro. I'm developing a Java application that uses a JTabbedPane object to allow the user to traverse through different JPanels of the application. I want the user to be able to drag any of the tabs in the JTabbedPane, and if they drag it out of the JFrame window then it creates a new JFrame with the JPanel that was draged out through the tab.

My initial approach is to send the JPanel object through a mouseListener that is attached to the JTabbedPane but I'm not really sure that it would work. If any of you have any ideas, please let me know.
Question by:vferreira71
1 Comment
LVL 26

Accepted Solution

ksivananth earned 2000 total points
ID: 20038830
I would suggest you that you take the data model from the original panel and pass to the DnD handler, the handler would reconstruct the panel and set the data model to that.

your approach of sending the panel object won't work since the same instance of UI component can not be displayed two places!

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question