import java.awt.*; import java.awt.event.*; import java.applet.Applet; import java.io.*; public class Tekstiredaktor2 extends Applet implements ActionListener { Frame save_aken=new Frame("SAVE/OPEN"); Button save_nupp=new Button("SAVE"); TextArea tekstiala=new TextArea(); TextField title=new TextField("Untitled"); Panel save_panel=new Panel(new GridLayout(1,2)); List list=new List(); String s; // nupu käskude kontroll String o_c; // open-close kontroll, et siis kumb int num_letters; public Tekstiredaktor2(){ Button salvesta=new Button("SAVE"); Button uus=new Button("NEW"); Button ava=new Button("OPEN"); Button word=new Button("Words:"); Button letter=new Button("Letters:"); TextField t_word=new TextField(); TextField t_letter=new TextField(""+num_letters); Panel ylemine=new Panel(new GridLayout(1,3)); Panel alumine=new Panel(new GridLayout(1,4)); ylemine.add(uus); ylemine.add(ava); ylemine.add(salvesta); alumine.add(letter); alumine.add(t_letter); alumine.add(word); alumine.add(t_word); setLayout(new BorderLayout()); add(ylemine, BorderLayout.NORTH); add(alumine, BorderLayout.SOUTH); add(tekstiala); salvesta.setActionCommand("save"); salvesta.addActionListener(this); uus.setActionCommand("new"); uus.addActionListener(this); ava.setActionCommand("open"); ava.addActionListener(this); word.setEnabled(false); letter.setEnabled(false); t_word.setEnabled(false); t_letter.setEnabled(false); } public void savebox(){ //List list=new List(); // hiljem kataloogi nimistu //Panel save_panel=new Panel(new GridLayout(1,2)); save_nupp.setActionCommand("close"); save_nupp.addActionListener(this); save_panel.add(title); save_panel.add(save_nupp); setLayout(new BorderLayout()); save_aken.add(list); save_aken.add(save_panel, BorderLayout.SOUTH); save_aken.setSize(100,200); save_aken.setLocation(250,150); save_aken.setVisible(true); File kataloog=new File("."); String failid[]=kataloog.list(); for(int x=0;x