• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advice on how to implement this GUI ?

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

My name is albert kam .. I hope you could give me pointers about these matters.

I need gui components that is also available in these screenshots of partition magic 8.

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 ?

Please advice ..

Regards,
Albert Kam
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's what the JSplitPane class does.
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's an idea:
 
Albert Kam
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all !

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
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic