import java.awt.*; import java.awt.event.*; import java.applet.Applet; import java.io.*; import java.util.Date; //import java.util.List; public class Tekstiredaktor2 extends Applet implements ActionListener { Frame save_aken=new Frame("Save/Open"); Button save_nupp=new Button("SAVE"); Button t_modified=new Button(); 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 modified=new Button("Last modified: "); //Button t_modified=new Button(); Panel ylemine=new Panel(new GridLayout(1,3)); Panel alumine=new Panel(new GridLayout(1,2)); ylemine.add(uus); ylemine.add(ava); ylemine.add(salvesta); alumine.add(modified); alumine.add(t_modified); 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); modified.setEnabled(false); t_modified.setEnabled(false); } public void savebox(){ 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(150,200); save_aken.setLocation(250,200); save_aken.setVisible(true); File kataloog=new File("."); String failid[]=kataloog.list(); for(int x=0;x