import java.awt.*;
import java.awt.event.*;

public
class HelloApp extends Frame implements WindowListener, ActionListener
{
   Button button;
   public HelloApp ()
   {
      super();
      addWindowListener(this);
      setSize(320, 200);
      setTitle("Moja aplikacja w Javie");
      setLayout(null);

      button = new Button("OK");
      button.setBounds(135, 90, 50, 20);
      button.addActionListener(this);
      
      add(button);
      setVisible(true);
      button.setVisible(true);
   }
   public void actionPerformed(ActionEvent e){
      String command = e.getActionCommand();
      if (command.equals("OK")){
         FileDialog fd = new FileDialog(this);
         fd.show();
      }
   }
   public void paint(Graphics gDC)
   {
   }
   public static void main(String args[])
   {
      new HelloApp();
   }
   public void windowClosing(WindowEvent e){
      System.exit(0);
   }
   public void windowClosed(WindowEvent e){
   }
   public void windowOpened(WindowEvent e){
   }
   public void windowIconified(WindowEvent e){
   }
   public void windowDeiconified(WindowEvent e){
   }
   public void windowActivated(WindowEvent e){
   }
   public void windowDeactivated(WindowEvent e){
   }
}
