NAVO Java Workshop, September 24, 1998
Writing a Java Applet using the Abstract Windowing Toolkit (AWT)


Choose a Lab problem that fits your interests, or do as many as time permits.

  1. Simple Graphics

    Pick a Java graphics applet to work with, such as:

    MyRect.java and MyRect0.html

    or Mushroom.java and Mushroom.html

    Copy these files to your local disk. Use your text editor to change some of the graphics properties, such as color, or experiment with different shapes, using the methods listed on page III-4 of the notes.

    Compile the java applet and view the html page.

  2. AWT Components

    Copy the file:

    VolumeApplet.java and

    VolumeApplet.html

    Modify this applet so that the user types in two numbers and the result of adding them together is printed out. Hint: Add an additional label and textfield where the user can type in a second number.

    You may also want to add more components, such as a set of checkboxes to change the background color.

    For examples of AWT components, Simple AWT Examples

    If your example gets complicated, you may want to add a Layout.

    For examples of Layouts, Simple Layout Examples

  3. Animation, Child Classes

    Write a Java applet with moving objects, from the mPoint classes


Nancy McCracken at the Northeast Parallel Architectures Center.