import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Varvirakend2 extends Applet implements AdjustmentListener{ Varv ng=new Varv(); Scrollbar sb=new Scrollbar( Scrollbar.VERTICAL, 0, 2, 0, 1000 ); public void init(){ setLayout(new BorderLayout()); add(sb, BorderLayout.WEST); add(ng, BorderLayout.CENTER); sb.addAdjustmentListener(this); } public void adjustmentValueChanged(AdjustmentEvent e){ ng.muudaVarv(e.getValue()); } // public static void main(String argumendid[]){ // Frame f=new Frame("Hulknurk"); // Applet ap=new Varvirakend2(); // ap.init(); // f.add(ap); // f.setSize(300, 300); // f.setVisible(true); // } }