Back to Applets page
Click in the boxes below, select all and copy to grab the applet
HTML listing:
<HTML> <HEAD> <TITLE>Listing 9.5</TITLE> </HEAD> <BODY BGCOLOR=WHITE> <APPLET CODEBASE="classes" CODE="Applet5.class" WIDTH=400 HEIGHT=100> </APPLET> </BODY> </HTML>
Applet listing:
import java.awt.*; import java.applet.*; public class Applet5 extends Applet { public void init() { setBackground(Color.white); this.setLayout(new GridLayout(0,3,20,20)); for (int i=1; i<10; i++) { this.add(new Button(" Button "+i)); } } }