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