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 RatioLayoutTest source code.

HTML Interface to Applet


<APPLET CODEBASE="/applets/magelang/AWT-Training/classes/" CODE="RatioLayoutTest.class" WIDTH=400 HEIGHT=180 ALIGN=CENTER></APPLET>

Java Code


import java.awt.*;

public class RatioLayoutTest extends java.applet.Applet {
    public void init() {
        setLayout(new RatioLayout());
        add("c,.1", new Label("A RatioLayout Test Applet"));
        add("c,c",  new Button("Button"));
        add("0,.7;.5,.3", new TextArea());
        add(".7,.7", new Button("OK"));
        add(".7,.85", new Button("BYE"));
    }
}