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

JButton emptyBorder not working  RSS feed

 
John Ironmonger
Greenhorn
Posts: 8
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to get all of my buttons to move down my frame a bit, without increasing the space between them (the insets). I've tried creating an empty border and adding it to both the panel and the button but it does not affect how it looks. Here's a picture of how it looks and how I want it to look, : http://imgur.com/dDBISFZ .

Here's my JFrame class :



And my MainMenu class, that contains the buttons with the panels :



Any help is greatly appreciated, thank you!
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using an EmptyBorder works fine for me.

Post a SSCCE that demonstrates your problem. You problem is with a button. So create a JFrame with a single JButton and use an EmptyBorder. Once you get it working in a simple test case you apply the working code to your real code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!