java리스너
-
java 리스너 이벤트 처리 방법 (익명 객체, 내부 클래스)JAVA/멀티스레드, 이벤트 2024. 5. 24. 10:02
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스💫이벤트 처리 ❓이벤트 리스너란?발생된 이벤트 객체에 반응하여 이벤트를 처리하는 객체를 말한다.사용자가 버튼을 클릭하거나, 마우스를 움직이거나, 키보드를 누르면 이벤트가 발생한다.class --Listener implements ActionListener{ public void actionPerformed (ActionEvent e){... //이벤트 객체가 발생하면 호출}} 이벤트를 처리하는 몇가지 방법이 있다.이 글에서는 이벤트 처리 코드를 정리해보고자 한다. - inner Class로 받아서 처리하는 방법- 익명클래스로 처리하는 방법 ✔ implements ActionListener 사용💻 코드로 보기public ..