正在加载图片...
Handling action Events-action Performed public void actionPerformed( ActionEvent event Button clickedButton =(Button) event. getsource()i f(clickedButton = cancelButton) setTitle( You clicked CANCEL") else( //the event source is okButton setTitle( You clicked OK") Define the action Performed method in the class that implements the actionlistener interface C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 13-8© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 13 - 8 Handling Action Events - actionPerformed public void actionPerformed( ActionEvent event ) { Button clickedButton = (Button) event.getSource(); if (clickedButton == cancelButton) { setTitle( "You clicked CANCEL" ); } else { //the event source is okButton setTitle( "You clicked OK" ); } } Define the actionPerformed method in the class that implements the ActionListenerinterface
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有