import java.applet.*; import java.awt.*; import java.net.*; public class Pa2 extends Panel{ Tah06 a; Panel p, np, np2, pp, pp21, pp22, pp23, pp24; Nupp n1, n2, n3, n4, n5, n6, n7, n8; Nupp n21, n22, n23; Button butt=new Button("Send"); Pa2(Applet ap){ p=new Panel(); p.add(a=new Tah06(220, 140)); pp=new Panel(); pp.setLayout(new BorderLayout()); pp.add("North", p); np=new Panel(); np.setLayout(new GridLayout(4, 2)); 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"))); np.add(n7=new Nupp(20, 30, ap.getImage(ap.getCodeBase(), "nkulik.gif"))); add(np); pp21=new Panel(); pp21.setLayout(new FlowLayout()); n21=new Nupp(30, 20, ap.getImage(ap.getCodeBase(),"nvalge.gif")); pp21.add(n21); n22=new Nupp(30, 20, ap.getImage(ap.getCodeBase(),"nmust.gif")); pp22=new Panel(); pp22.setLayout(new FlowLayout()); pp22.add(n22); n23=new Nupp(30, 20, ap.getImage(ap.getCodeBase(),"npunane.gif")); pp23=new Panel(); pp23.setLayout(new FlowLayout()); pp23.add(n23); pp24=new Panel(); pp24.setLayout(new FlowLayout()); pp24.add(butt); np2=new Panel(); np2.setLayout(new GridLayout(1, 4)); np2.add(pp21); np2.add(pp22); np2.add(pp23); np2.add(pp24); pp.add("South", np2); add(pp); } public String pildistring(){return a.pildistring();} public void stringipilt(String s){a.stringipilt(s);} 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();} if(e.target.equals(n6)){a.tagasi();} if(e.target.equals(n4)){a.ruutjuur();} if(e.target.equals(n5)){a.tuhjaks();} if(e.target.equals(n21)){a.seaVarv(Color.white);} if(e.target.equals(n22)){a.seaVarv(Color.black);} if(e.target.equals(n23)){a.seaVarv(Color.red);} if(e.target.equals(n7)){a.kulik();} return super.mouseUp(e, x, y); } }