This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there something like a GroupBox in Swings ?!!  RSS feed

 
Meghna ks
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • 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

 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!