import java.awt.*; import java.io.*; import java.awt.event.*; public class NotPad extends Panel implements ActionListener, TextListener{ TextArea TextiAla=new TextArea(1000,1000); Label TahtiKiht = new Label("Tähti : 0"); Label SonuKiht = new Label("Sõnu : 0"); Label RiduKiht = new Label("Ridu : 0"); Label FailiAla = new Label("< Faili nimi"); Label ParooliKiht = new Label("< Parool"); Label avatud1 = new Label("<>"); Label avatud2 = new Label("<>"); Label avatud3 = new Label("<>"); Label Jooksev = new Label(""); Button salvesta=new Button("Salvesta"); Button ava=new Button("Ava"); Button kustuta=new Button("Uus fail"); Button v2lja=new Button("Välju"); Button Naita1=new Button("Näita"); Button Naita2=new Button("Näita"); Button Naita3=new Button("Näita"); TextField FNimeVali=new TextField(""); TextField ParooliVali=new TextField(""); public NotPad() { setLayout(new BorderLayout()); add(TextiAla, BorderLayout.CENTER); Panel YlaPaneel=new Panel(new GridLayout(1,1)); YlaPaneel.add(Jooksev); add(YlaPaneel, BorderLayout.NORTH); Panel NupuPaneel2=new Panel(new GridLayout(7,1)); NupuPaneel2.add(Naita1); NupuPaneel2.add(avatud1); NupuPaneel2.add(Naita2); NupuPaneel2.add(avatud2); NupuPaneel2.add(Naita3); NupuPaneel2.add(avatud3); Panel NupuPaneel3=new Panel(new GridLayout(5,1)); NupuPaneel3.add(ava); NupuPaneel3.add(kustuta); NupuPaneel3.add(salvesta); NupuPaneel3.add(v2lja); Panel InfoPaneel=new Panel(new GridLayout(5,1)); InfoPaneel.add(TahtiKiht); InfoPaneel.add(SonuKiht); InfoPaneel.add(RiduKiht); Panel ParemPaneel=new Panel(new GridLayout(3,1)); ParemPaneel.add(NupuPaneel3); ParemPaneel.add(InfoPaneel); ParemPaneel.add(NupuPaneel2); add(ParemPaneel, BorderLayout.EAST); salvesta.addActionListener(this); kustuta.addActionListener(this); ava.addActionListener(this); v2lja.addActionListener(this); TextiAla.addTextListener(this); FNimeVali.addTextListener(this); Naita1.addActionListener(this); Naita2.addActionListener(this); Naita3.addActionListener(this); Panel AlaPaneel=new Panel(new GridLayout(1,2)); AlaPaneel.add(FNimeVali); AlaPaneel.add(FailiAla); AlaPaneel.add(ParooliVali); AlaPaneel.add(ParooliKiht); add(AlaPaneel, BorderLayout.SOUTH); } public void textValueChanged(TextEvent e){ int tahti=0; int ridu=0; int sonu=0; int a=0; double realugeja=0; java.lang.String abi=""; for(int i=0; i> Ei leidu faili, faili nime ei ole määratletud vms... "); System.out.println("Viga!"); } } public static void main(String args[]){ Frame f=new Frame("NotPad at All"); f.add(new NotPad()); f.setSize(800,500); f.addWindowListener(new AknaKuulaja()); f.setVisible(true); } } class AknaKuulaja extends WindowAdapter{ public void windowClosing(WindowEvent e){ System.out.println("Programm suleti!"); System.exit(0); } } //by hheinz