View Single Post
  #1 (permalink)  
Old 07-24-2007, 05:24 PM
toby toby is offline
Member
 
Join Date: Jul 2007
Posts: 40
toby is on a distinguished road
Use GridLayout in java
Hi, I am trying to make a Java Applet and using gridlayout
Here's the code:

Code:
setLayout(new GridLayout(2,2)); ButtonA = new Button("A"); ButtonB = new Button("B"); ButtonC = new Button("C"); ButtonD = new Button("D"); add(ButtonA,"1"); add(ButtonB,"2"); add(ButtonC,"3"); add(ButtonD,"4");
Unfortunately, this code makes all the buttons stretch towards the whole screen that's 400x400, what if i want to make it in the middle that's 200x200 on a 400x400 applet.
Thanks
Reply With Quote
Sponsored Links