Swing ActionListener probelm
843807Apr 2 2003 — edited Apr 2 2003I have create my own panel containing 4 buttons
addButton = new JButton("Add");
addButton.addActionListener(this);
This gets added into a mainPanel which is then called to make up part of the JFrame:
bp = new bottomPanel();
My problem is that I can't get the actionListener to work. If I put it in my own panel then it knows nothing of the overall panel that I want to be able to change on the press of the add button. And I can't figure out how to get it to work from the main JFrame. Is it possible to create the Listener as a separate class and create an instance of it inside the Panel/Frame to call the required operation???
I'd really appreciate any help at all!!
Thanks