im having a problem with this atm program........
an error is occured with this code
CODE
"f.setPreferredSize(new Dimension(300, 200));"[code]
[code]:
import java.awt.*;
import javax.swing.*;
public class ATM
{
private JFrame f;
private JTextField vn;
private JTextArea v;
private JPanel p;
private JPanel pp;
private JPanel ppp;
private JPanel pppp;
private JButton one, two, three;
private JButton q, w, e, r, t, y, u, i, o, n, a, s;
public ATM()
{
f = new JFrame("ATM Program");
p = new JPanel();
pp = new JPanel();
ppp = new JPanel();
pppp = new JPanel();
vn = new JTextField();
v = new JTextArea();
one = new JButton("Display Account Balance");
two = new JButton("Make a Deposit");
three = new JButton("Make a Withdraw");
q = new JButton("1");
w = new JButton("2");
e = new JButton("3");
r = new JButton("4");
t = new JButton("5");
y = new JButton("6");
u = new JButton("7");
i = new JButton("8");
o = new JButton("9");
n = new JButton("0");
s = new JButton(".");
a = new JButton("Enter");
}
public void ATM()
{
f.setPreferredSize(new Dimension(300, 200));
pp.setLayout(new GridLayout(4,1));
pp.add(one);
pp.add(two);
pp.add(three);
pp.add(vn);
p.add(pp, BorderLayout.NORTH);
pppp.setLayout(new GridLayout(1, 0));
pppp.add(v = new JTextArea(20, 20));
p.add(pppp, BorderLayout.CENTER);
ppp.setLayout(new GridLayout(4,3));
ppp.add(q);
ppp.add(w);
ppp.add(e);
ppp.add(r);
ppp.add(t);
ppp.add(y);
ppp.add(u);
ppp.add(i);
ppp.add(o);
ppp.add(n);
ppp.add(a);
ppp.add(s);
p.add(ppp, BorderLayout.SOUTH);
f.add(p);
f.pack();
f.setVisible(true);
}
public static void main(String args[])
{
ATM guiWindow = new ATM();
guiWindow.ATM();
}
}
i hope you can fix the problem
i dont know what code im going to put with the deposit and withdrawal button....
i hope you help me .....i need to pass this on the 15th of october 2008....
plzzz help me!!!! im begging you guyz....
This post has been edited by chengggg: 11 Oct, 2008 - 11:12 PM