• Post Reply Bookmark Topic Watch Topic
  • New Topic

really simple JButton question

 
kate damond
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I just want to set the margins, or pding or something on JButton, so the text on it fills more of the space (I mean not leaving a big gap all the way round the text on a button.)
Cheers,
Kate
 
Martin webster
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your answer is in the question
JButton but = new JButton();
but.setMargin(new Insets(top, left, bottom, right));
// where top, left, bottom and right are ints...
 
kate damond
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Martin - I was confused about the INSETS bit ! Works a treat.
Kate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!