import java.applet.*; import java.awt.*; import java.net.*; public class Pa2 extends Panel{ Tah05 a; TextArea ta=new TextArea(20, 20); Panel p, np, np2, pp; Nupp n1, n2, n3, n4, n5, n6; Nupp n21, n22, n23; Button butt=new Button("Send"); Pa2(Applet ap){ p=new Panel(); p.add(a=new Tah05(200, 100)); //setLayout(new BorderLayout()); pp=new Panel(); pp.setLayout(new GridLayout(2, 1)); pp.add(p); np=new Panel(); np.setLayout(new GridLayout(3, 2)); //u1=new URL("http://minitorn.tpu.ee/~jaagup/oma/katse/chat/k5/nsodi.gif"); np.add(n1=new Nupp(20, 30, ap.getImage(ap.getCodeBase(), "nsodi.gif"))); np.add(n2=new Nupp(20, 30, ap.getImage(ap.getCodeBase(), "njoon.gif"))); np.add(n3=new Nupp(20, 30, ap.getImage(ap.getCodeBase(), "naa.gif"))); np.add(n4=new Nupp(20, 30, ap.getImage(ap.getCodeBase(), "njuur.gif"))); np.add(n5=new Nupp(20, 30, ap.getImage(ap.getCodeBase(), "nuus.gif"))); np.add(n6=new Nupp(20, 30, ap.getImage(ap.getCodeBase(), "nundo.gif"))); add(np); n21=new Nupp(30, 20); n22=new Nupp(30, 20, Color.black); n23=new Nupp(30, 20, Color.red); np2=new Panel(); np2.setLayout(new GridLayout(1, 3)); np2.add(n21); np2.add(n22); np2.add(n23); np2.add(butt); pp.add(np2); add(pp); add(ta); //p.resize(300, 300); //add("Center", a); } public boolean mouseUp(Event e, int x, int y){ if(e.target.equals(n1)){a.sodi();} if(e.target.equals(n2)){a.joon();} if(e.target.equals(n3)){a.kirjuta(); ta.appendText("Kirjuta");} if(e.target.equals(n6)){a.tagasi();} if(e.target.equals(n4)){a.ruutjuur();} if(e.target.equals(n5)){a.tuhjaks();} return super.mouseUp(e, x, y); } }