small bit of code . actionlistener not working
hello, i am trying to get this actionlistener for the button bNew to work but it gives me the error cannot find symbol variable bNew. im guessing inside actionperformed it cannot see it, but it should right ? .. any help appreciated.
thanks :)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
* Sample application using Frame.
*
* @author
* @version 1.00 07/02/05
*/
publicclass InvoiceFrameextends JFrameimplements ActionListener
{
/**
* The constructor.
*/
public InvoiceFrame()
{
JButton bNew =new JButton("New Invoice");
JButton bLoad =new JButton("Load Invoice");
bNew.addActionListener(this);
bLoad.addActionListener(this);
JTextArea taDisplay =new JTextArea(10,10);
JPanel center =new JPanel();
JPanel south =new JPanel();
Container c = getContentPane();
c.setLayout(new BorderLayout());
c.add(center, BorderLayout.CENTER);
c.add(south, BorderLayout.SOUTH);
center.add(taDisplay);
south.add(bLoad);
south.add(bNew);
this.setSize(400,400);
this.setVisible(true);
this.setTitle("Invoice Mate");
}
publicvoid actionPerformed(ActionEvent ae)
{
if ( ae.getSource() == bNew )
{
taDisplay.append("blah");
}
}
}

