Using Component Methods

Let's suppose, for example, you want to write an applet that uses a Label whose text is 24 point, SansSerif, bold and blue and whose background color is yellow.

import java.awt.*;
import java.applet.*;

public class CubScouts extends Applet {

  public void init() {
     Label cubScouts = new Label("Cub Scouts!");
     cubScouts.setFont(new Font("Sans", Font.BOLD, 24)); 

Cub Scouts applet
Previous | Next | Top | Cafe au Lait

Copyright 1998 Elliotte Rusty Harold
Last Modified June 26, 1998