ImageIcon tenP1 = new ImageIcon("10p.gif");
tenP = new JButton("", tenP1);
ImageIcon twentyP1 = new ImageIcon("20p.gif");
twentyP = new JButton("", twentyP1);
ImageIcon fiftyP1 = new ImageIcon("50p.gif");
fiftyP = new JButton("", fiftyP1);
ImageIcon pound = new ImageIcon("pound.gif");
onePound = new JButton("", pound);
ImageIcon twopound = new ImageIcon("twopound.gif");
twoPound = new JButton("", twopound);
for above set of buttons can someone please show me how to do a single action listener that would add that specific amount to "Amount Insert" and decrease that specific amount to "Amount Due" please :)
so something like this but how do one single action listerer? can i do switch statement. please show me using code?
twentyP.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
amountIn = amountIn + 0.20;
amInseted.setText("Amount Instered: \u00A3" + amountIn);
}});