This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting the JFrame contentpane's border

 
Chris Ramsey
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to create an empty border on the JFrame's contentpane, so that when I add components to it the will not be placed flushed with the sides? I would like to do this without having to add a JPanel to the contentpane first. Thank you.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you have to do is cast the content pane to a JComponent and set the border...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic