CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades

Applets

Applets
Develop and test
Code

The code for the Future Value Calculator applet

import java.awt.*;
import javax.swing.*;

public class FutureValueApplet extends JApplet
{
    public void init()
    {
        JPanel panel = new FutureValuePanel();
        this.add(panel);
    }
}

How to modify the code for the FutureValuePanel class so it can be used with an applet

public class FutureValuePanel extends JPanel implements ActionListener
{
    // the declarations should not include an Exit button

    public FutureValuePanel()
    {
        // the constructor should not create an Exit button
    }

    public void actionPerformed(ActionEvent e)
    {
        // the ActionListener should not respond to the
        // Exit button
    }
}
Previous | Future Value Calculator applet | Code | HTML page for an applet | Test with Applet Viewer | Convert HTML page for an applet | Code for the converted HTML page | Test from a Web browser | Next