Hi all, help me with desktop App. How do I make frames (in my case InternalFrames) dock (dockable) at the edges of the application as an eclipse views, is there a way to do it by swing (JInternalFrame).
Thanks an advance.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi all, help me with desktop App. How do I make frames (in my case InternalFrames) dock (dockable) at the edges of the application as an eclipse views, is there a way to do it by swing (JInternalFrame).
Thanks an advance.
Assuming you don't want to use a third party library to handle the docking procedure, yes it can be done. Off the top of my head I can think of a few things you would have to do.
1. Create a custom class that extends JInternalFrame and add variables/methods to it for handling docking.
2. Create a custom class that extends JDesktopPane which would hold the custom JInternalFrame and contain variables/methods for setting/moving dockable areas.
3. You would need to keep track of mouse button down/up and mouse movement to recognize if a dockable frame has been selected and whether or not the mouse is over a dockable area.
To surmise, it is definitely possible to do if you are willing to put forth the effort and are ready for a few headaches along the way. If, however, this seems like too much of a chore then I would definitely go with a third-party library.