import java.applet.*; import java.awt.*; public class Esim24 extends Applet { Button nappi1,nappi2,nappi3,nappi4,nappi5; public void init () { GridBagLayout x = new GridBagLayout(); GridBagConstraints y = new GridBagConstraints(); setLayout(x); add(nappi1 = new Button("Eka")); y.fill = GridBagConstraints.BOTH; y.weightx = 0.5; y.weighty = 1.0; y.gridheight = 2; x.setConstraints(nappi1,y); add(nappi1); add(nappi2 = new Button("Toka")); y.gridheight = 1; x.setConstraints(nappi2,y); add(nappi2); add(nappi3 = new Button("Kolmas")); // Rivin viimeinen y.gridwidth = GridBagConstraints.REMAINDER; y.gridheight = 1; x.setConstraints(nappi3,y); add(nappi3); add(nappi4 = new Button("Neljäs")); // Rivin viimeinen y.gridwidth = GridBagConstraints.REMAINDER; x.setConstraints(nappi4,y); add(nappi4); add(nappi5 = new Button("Viides")); // Rivin viimeinen y.gridwidth = GridBagConstraints.REMAINDER; x.setConstraints(nappi5,y); add(nappi5); } }