At screenshot 2, where there are 3 partitions. If i were to - right click one of the partition, and choose resize, - i can resize the partition from the partition boxes by hovering it, - and the cursor changes into left and right arrow, - and then i can drag to the left or right, and then release.
What's the better way to do this in Java GUI ? My imagination says to use JLabel for this, where i could implement own's coloring by playing with it's Graphics2D.
Also, i could add the right click popup listener.
But to be dragable to left and right, and to change the cursor while hovering the edge of the partition box, how do i achieve that ?
I was told to use a split pane too, but i assumed that split pane only split into 2, and in the screenshots there are several partitions .. But i'll take a look into this component as i'm not familiar with it yet. Thanks !
I've tried running the code, it runs great after editing it to become f.getContentPane().add(xxx). I'll study this code as soon as i get home ! Thank you !
Regards, Albert Kam
Joined: Mar 22, 2005
Yes, split panes always have two components. If your GUI has more than two panes, you'd create a hierarchy of panes, in other words, a toplevel split pane that contains two JPanels that contain second-level split panes.