public class Bank extends Applet
implements ActionListener
{
private Button savingsButton, checkingButton;
private TextField amountTF;
private int amount;
private int check;
private int save;
private Account checking, saving;
public void init()
{
Label inputLbl;
inputLbl = new Label("Enter an amount to deposit or withdraw:");
add(inputLbl);
amountTF = new TextField(10);
add(amountTF);
amountTF.addActionListener(this);
savingsButton = new Button("Savings");
add(savingsButton);
savingsButton.addActionListener(this);
checkingButton = new Button("Checking");
add(checkingButton);
checkingButton.addActionListener(this);
I wrote the above program for simulating a bank account which works fine but the rule is that i should use display method for displaying the output and should put the code inside this method instead of where i have put it in paint and call the method inside paint(). I am not sure how to do that. Can anyone help me..
kanakatam
Bookmarks