JAVA/GUI - Swing

KeyEvent를 통해 입력된 키를 출력하기

DesignatedRoom 2020. 10. 24. 22:32

 

KeyDemoFrame.java

소스 파일

KeyDemoFrame.java
0.00MB

 

 

 

 

KeyDemo.java

소스 코드

더보기
import javax.swing.JFrame;

public class KeyDemo 
{
   public static void main( String args[] )
   { 
      KeyDemoFrame keyDemoFrame = new KeyDemoFrame(); 
      
      keyDemoFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
      keyDemoFrame.setSize( 350, 100 ); // set frame size
      keyDemoFrame.setVisible( true ); // display frame
   } // end main
} // end class KeyDemo

 

프로그램 실행결과