-
JButton Help
See i have a frame and it contains multiple panels
These panels contain buttons
Now i want to add a feature in my frame that the user can change the position of the panels by dragging them anywhere in the frame like JTable columns can change their position
So can anybody help me please
-
Re: JButton Help
When you mention JTable, I'm thinking you just want to drag to change the panel size? If so, then a JSplitPane, or combination of several JSplitPanes, may work well for what you want. If you really want to be able to drag the panels and drop them elsewhere, then you need to code in drag and drop functionality, which is a lot more complicated
-
Re: JButton Help
Thanks for ur reply but i am making a dock in that i have dock items stored in JPanel so now i want to add functionality to it that the user can drag and drop the panel as per his/her requirements.
So if there is any way then guide me the approach toward this problem
Thanks in advance
-
Re: JButton Help
To do so is not trivial, so I will point you to Introduction to DnD (The Java™ Tutorials > Creating a GUI With JFC/Swing > Drag and Drop and Data Transfer). You could also google 'drag and drop java jpanel' (or something to that effect) and perhaps dig up some code that does something similar to what you want.