import java.awt.*; import java.applet.Applet; public class GridBag4 extends Applet{ public GridBag4(){ GridBagLayout gb=new GridBagLayout(); GridBagConstraints c =new GridBagConstraints(); setLayout(gb); Button nupp1=new Button("Nupp 1"); Button nupp2=new Button("Nupp 2"); c.gridx=c.gridy=0; c.weightx=2; c.weighty=1; c.fill=GridBagConstraints.BOTH; gb.setConstraints(nupp1, c); add(nupp1); c.gridx=1; c.weightx=1; gb.setConstraints(nupp2, c); add(nupp2); } public static void main(String argumendid[]){ Frame f=new Frame("Paigutus"); f.add(new GridBag4()); f.setSize(200, 200); f.setVisible(true); } }