Technical Support
Discussion Forum
Online Training
Read About Java
Java In-Depth
Product Discounts
Membership Information

Java Cup Logo

JDC Home Page


Working Applet
Help and Hints
Source Code
Table of Contents
Online Training
shadowSearchFAQFeedback

Solution

Download FlowLayoutTest source code.

HTML Interface to Applet


<APPLET CODEBASE="/applets/magelang/AWT-Training/classes/" CODE="FlowLayoutTest.class" WIDTH=300 HEIGHT=150 ALIGN=CENTER></APPLET>

Java Code


import java.awt.*;

public class FlowLayoutTest extends java.applet.Applet {

    public void init() {
        setLayout(new FlowLayout());    // default for Applets

        add(new Button("First"));
        add(new Button("Second"));
        add(new Button("Third"));
        add(new Button("Fourth"));
        add(new Button("Fifth"));
    }
}