This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

button size and frame border

 
William Cowie
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a complete noob with java so bear with me, anyway I have created a simple calculator in the windows style(well that is the idea), I am trying to change the blank button in my code to the same size as the memory buttons down the left hand side but it just stretches. Also I am trying to create a small border round the number, operator and text panels any ideas how to sort these?

heres a pic: http://www.itshops.co.uk/calc.jpg

 
Campbell Ritchie
Sheriff
Pie
Posts: 47288
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Of course it stretches. Java Layout Managers are designed that when the size of the whole window changes, the individual components change too.

Go to Cay Horstmann's website, and find the GBC class, then use it to help with the GridBagLayout, which allows you to put an Inset around a button.

You can miss out the line about import java.lang.*; .
Also if you use J2SE 5.0 you can forget about pane and just add() all the components directly.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic