• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Is there something like a GroupBox in Swings ?!!

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is there something like a GroupBox in Swings ?!!I mean something like a Panel, but not panel, to which a header could be added and some swing components like Buttons., Labels can be grouped together. It should look something like this ..
|-------I'm the Header------------------|
| |
| Label TextField |
| Label TextField |
| |
| Button |
-----------------------------------------
Please let me know if you guys can find something like this
Thanks
Meghna

 
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can set borders on your JComponents, for example:

Check out the tutorial at http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html
 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael
Thanks for the reply, but the idea is not to use the Panel at all, but to use something different to give the look and feel of the groupbox like that we use in VB. Please correct me if I'm wrong.
Thanks
Meghna
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's been a while since I did a GUI in VB, I think this would be the preferred way in Java.
You text fields and buttons are going to be contained within a panel anyway, right? Plus, it makes logical sense to have groupings in a JPanel, then you can put that panel anywhere you want.
If I remember correctly, in VB you just drag a border like this. I guess you could figure out how to draw one manually, doesn't sound like fun.
reply
    Bookmark Topic Watch Topic
  • New Topic