JAVA 프로그래밍

문제

버튼을 누르면 자동으로 문이 열리는 과정을 모델링하는 문제입니다 이를 해결하는 다음 프로그램에 대해 빈칸을 채우세요 
 

코드 빈칸 채우기

 javax.swing.*; 
  
  AutomaticDoorGUIMain 
{ 
	public static void main( String[] args ) { 
		 frame =  ( "자동문" ); 
		frame.getContentPane().(  AutomaticDoorPanel() ); 
		frame.setDefaultCloseOperation( .EXIT_ON_CLOSE ); 
		frame.pack(); 
		frame.setVisible(true); 
	} 
} 
 
 java.awt.*; 
 java.awt.event.*; 
 javax.swing.*; 
 
  AutomaticDoorPanel  JPanel 
{ 
	  door; 
	  button; 
	 boolean open; 
 
	 AutomaticDoorPanel() { 
		door = this; 
		open = false; 
		setBackground( Color.cyan ); 
		setPreferredSize(  Dimension( 250, 400 ) ); 
		 
		button =  ( "문열기" ); 
		button.(  ClickListener() ); 
		( button ); 
	} 
 
	  ClickListener   { 
		@Override 
		 void (  event ) { 
			if ( open == false ) { 
				open = true; 
				door.setBackground( Color.white ); 
				button.( "문닫기" ); 
			} 
			else { 
				open = false; 
				door.setBackground( Color.cyan ); 
				button.( "문열기" ); 
			} 
		} 
	} 
}