import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Graafikarakend1 extends Applet implements AdjustmentListener{ Komponent r=new Komponent(); Scrollbar sb=new Scrollbar( Scrollbar.VERTICAL, 3, 2, 2, 20 ); Scrollbar sb2=new Scrollbar( Scrollbar.VERTICAL, 3, 2, 2, 200 ); public Graafikarakend1(){ setLayout(new BorderLayout()); add(sb, BorderLayout.WEST); add(sb2, BorderLayout.EAST); add(r, BorderLayout.CENTER); sb.addAdjustmentListener(this); sb2.addAdjustmentListener(this); } public void adjustmentValueChanged(AdjustmentEvent e){ r.muudaKiirus(sb.getValue()); r.muudaSuurus(sb2.getValue()); } public static void main(String[] argumendid){ Frame f=new Frame("Ringike"); f.add(new Graafikarakend1()); f.setSize(400, 400); f.setVisible(true); } }