import java.awt.*; import javax.swing.*; import java.applet.Applet; public class Paigutus2 extends JPanel{ JButton nupp1=new JButton("Esimene"); JButton nupp2=new JButton("Teine"); JButton nupp3=new JButton("Kolmas"); JPanel nupupaneel=new JPanel(new GridLayout(1, 3)); JTextArea tekstiala=new JTextArea(); JScrollBar kerimisriba=new JScrollBar(JScrollBar.HORIZONTAL); JPanel paneel2=new JPanel(new BorderLayout()); JPanel paneel3=new JPanel(new GridLayout(1, 4)); JPanel alapaneel=new JPanel(new GridLayout(2, 1)); public Paigutus2(){ setLayout(new BorderLayout()); add(tekstiala, BorderLayout.CENTER); nupupaneel.add(nupp1); nupupaneel.add(nupp2); nupupaneel.add(nupp3); add(nupupaneel, BorderLayout.NORTH); paneel2.add(kerimisriba, BorderLayout.CENTER); alapaneel.add(paneel2); alapaneel.add(paneel3); add(alapaneel, BorderLayout.SOUTH); } public static void main(String[] arg){ JFrame f=new JFrame("Paigutus"); f.getContentPane().add(new Paigutus2()); f.setSize(300, 300); f.setVisible(true); } }