Okay, so this is what it looks like so far.
Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
public class MakingBank extends JApplet
{
public static void main(String[] args)
{
JFrame frame = new JFrame();
JPanel panel2 = new JPanel();
panel.add(name);
panel.add(nameIGuess);
panel.add(address);
panel.add(place);
final PressButton john = new PressButton();
panel.add(pine, BorderLayout.CENTER);
panel.add(fresh);
panel.add(pine2, BorderLayout.CENTER);
panel.add(fresh2);
panel.add(pine3, BorderLayout.CENTER);
panel.add(fresh3);
panel.add(pine4, BorderLayout.CENTER);
panel.add(fresh4);
panel.add(enter);
panel.add(reciept);
panel.setBackground(background);
frame.add(panel);
frame.setTitle("Bank");
enter.addActionListener(PressButton.listener);
fresh.setText("0");
fresh2.setText("0");
fresh3.setText("0");
fresh4.setText("0");
reciept.setEditable(false);
place.setBackground(Color.WHITE);
nameIGuess.setBackground(Color.WHITE);
fresh.setBackground(Color.WHITE);
fresh2.setBackground(Color.WHITE);
fresh3.setBackground(Color.WHITE);
fresh4.setBackground(Color.WHITE);
reciept.setBackground(Color.WHITE);
frame.setSize(650, 650);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public static Color background = Color.GRAY;
public static final JLabel name = new JLabel("Name: ");
public static final JTextField place = new JTextField(50);
public static final JLabel address = new JLabel("Address: ");
public static final JTextArea reciept = new JTextArea(10, 30);
public static final JTextField nameIGuess = new JTextField(50);
public static final JLabel pine = new JLabel("Pine Tree Air Freshener ($9.99): ");
public static JTextField fresh = new JTextField(50);
public static final JLabel pine2 = new JLabel("Pine Tree Cologne ($10.99): ");
public static final JTextField fresh2 = new JTextField(50);
public static final JLabel pine3 = new JLabel("Pine Tree Puppets ($5.99): ");
public static final JTextField fresh3 = new JTextField(50);
public static final JLabel pine4 = new JLabel("Pine Tree Planter ($25.99): ");
public static final JTextField fresh4 = new JTextField(50);
public static final JPanel panelproduct = new JPanel();
public static final JPanel panel = new JPanel();
public static final JButton enter = new JButton("Enter");
}
We can't get it to run as an applet S:
Is there something we're using that just doesn't work that way?