正在加载图片...
GreetingApplet: Placing GUi objects public class GreetingApplet extends Applet private label prompt private label greeting; Declaration private TextField inputlinei public GreetingApplet( prompt new Label (Please enter your name")i greeting new Label( )i inputline new TextField( 15 )i add( prompt )i These statements add( greeting place Label and add( inputline )i TextField objects on this applet C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 5-5© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 5 - 5 GreetingApplet: Placing GUI Objects public class GreetingApplet extends Applet { private Label prompt; private Label greeting; private TextField inputLine; public GreetingApplet( ) { prompt = new Label(“Please enter your name”); greeting = new Label( ); inputLine = new TextField( 15 ); add( prompt ); add( greeting ); add( inputLine ); } } These statements place Label and TextField objects on this applet. Declaration
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有