|
|
|
|
|
|
SolutionDownload LabelTest source code.HTML Interface to Applet<APPLET CODEBASE="/applets/magelang/AWT-Training/classes/" CODE="LabelTest.class" WIDTH=300 HEIGHT=150 ALIGN=CENTER></APPLET> Java Codeimport java.awt.*; public class LabelTest extends java.applet.Applet { public void init() { setLayout(new GridLayout(3,1)); add(new Label("Left label")); // default left justify add(new Label("Center label", Label.CENTER)); // center add(new Label("Right label", Label.RIGHT)); // right justify } } |