달력

92025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30


import java.awt.Frame;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;

// 2. 상속
class InterWindowEx extends Frame implements WindowListener
{
 public InterWindowEx()
 {
  setSize( 200, 300 );
  setVisible( true );

  addWindowListener( this );           // 감지기 메소드
 }

    public void windowActivated(WindowEvent e) {}
 public void windowClosed(WindowEvent e) {}
 public void windowClosing(WindowEvent e)
 {
  System.exit( 0 );              // 닫으라는 명령
 }
 public void windowDeactivated(WindowEvent e) {}
 public void windowDeiconified(WindowEvent e) {}
 public void windowIconified(WindowEvent e) {}
 public void windowOpened(WindowEvent e) {}

 public static void main(String[] args)
 {
  new InterWindowEx();

  /*
  // 1. 객체 생성
  Frame f = new Frame();
  f.setSize( 200, 300 );
  f.setVisible( true );
  */
 }
}

Posted by cdprkr2077
|