package gui;
import java.awt.*;
import java.awt.event.*;
public class FileDialog implements ActionListener{
Frame f = new Frame("dialog");
FileDialog d1 = new FileDialog(f,"make load choice",FileDialog.LOAD);
FileDialog d2 = new FileDialog(f,"make save choice",FileDialog.SAVE);
Button b1 = new Button("open");
Button b2 = new Button("save");
public void go(){
b1.addActionListener(this);
b2.addActionListener(this);
f.add(b1);
f.add(b2,BorderLayout.SOUTH);
f.setVisible(true);
}
public void actionPerformed(ActionEvent e){
if(e.getSource()==b1){
d1.setVisible(true);
System.out.println(d1.getDirectory()+d1.getFile());
}else{
d2.setVisible(true);
System.out.println(d2.getDirectory()+d2.getFile());
}
}
public static void main(String[] args){
new FileDialog().go();
}
}