import javax.swing.*; public class Valikupaneel extends JApplet{ static JTabbedPane looValikuPaneel(){ JPanel p1=new JPanel(new java.awt.GridLayout(2,1)); p1.add(new JButton("Ülemine")); p1.add(new JButton("Alumine")); JTabbedPane paneel=new JTabbedPane(); paneel.add("Esimene", p1); paneel.add("Teine", new JLabel("Suur silt")); return paneel; } public void init(){ getContentPane().add(looValikuPaneel()); } public static void main(String argumendid[]){ JFrame f=new JFrame("Valikupaneeli näide"); f.getContentPane().add(looValikuPaneel()); f.setSize(200, 200); f.setVisible(true); } }