Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Padding Controls  RSS feed

 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgive my ignorance but I seldom work with Java GUI's and, when I do, I usually end up relearning all of the basics because it's been so long since I've last worked with it. Anyway, I have what I assume will be a very simple question.

I have a very simple GUI and everything is just as I'd like it except for the fact that the controls on the top, left, and right sides are pushed right up against the edge of the frame. I'd like there to be about 5 pixels of padding on all sides. Here's my code so far (there's no logic yet - I'm just trying to get the frame format down):



I know I've done this sort of thing before, but I suspect it will be faster to simply ask someone here than for me to try to look up the answer again. Thanks for your help.

Corey
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could check out the Insets class or take a look at http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html

Ed
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!