is not abstract and does not override abstract method actionPerformed

I dont how to corr. Please help!! and thank you very much!!

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

public class test extends JFrame implements ActionListener, ItemListener

{

private CenterPanel centerPanel;

private QuestionPanel questionPanel;

private ButtonPanel buttonPanel;

private ResponsePanel responsePanel;

private JButton b1,b2,b3,b4,b5;//Create five references to Jbutton instances

private JTextField t1,t2,t3,t4,t5;//Create five references to JTextField instances

private JLabel label1;//Create one references to JLabel instances

private JRadioButton q1,q2,q3;//Create three references to JRadioButton instances

private ButtonGroup radioGroup;//Create one references to Button Group instances

private int que1[] = new int[5]; //Create int[4] Array

private int que2[] = new int[5];

private int que3[] = new int[5];

private String temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10,

temp11, temp12, temp13, temp14, temp15;

public test (String header)

{

super(header);

Container container = getContentPane();

label1 = new JLabel ("PLease click on your response to ");

q1 = new JRadioButton("I understand most of the content of this subject",true);

add(q1);

q2 = new JRadioButton("I see the relevance of the subject to my degree",false);

add(q2);

q3 = new JRadioButton("The workload in this subject is appropriate",false);

add(q3);

radioGroup = new ButtonGroup();//JRadioButton belong to ButtonGroup

radioGroup.add(q1);

radioGroup.add(q2);

radioGroup.add(q3);

JPanel buttonPanel = new JPanel();

JPanel responsePanel = new JPanel();

JPanel questionPanel = new JPanel();

JPanel centerPanel = new JPanel();

b1 = new JButton ("Strongly DISAGREE");//Instantiate JButton with text

b1.addActionListener (this);//Register JButtons to receive events

b2 = new JButton ("DISAGREE");

b2.addActionListener (this);

b3 = new JButton ("Neither AGREE or DISAGREE");

b3.addActionListener (this);

b4 = new JButton ("AGREE");

b4.addActionListener (this);

b5 = new JButton ("Strongly AGREE");

b5.addActionListener (this);

buttonPanel.setLayout(new GridLayout(5,1));

buttonPanel.add(b1);

buttonPanel.add(b2);

buttonPanel.add(b3);

buttonPanel.add(b4);

buttonPanel.add(b5);

t1 = new JTextField ("0",3);//JTextField contains empty string

t2 = new JTextField ("0",3);

t3 = new JTextField ("0",3);

t4 = new JTextField ("0",3);

t5 = new JTextField ("0",3);

t1.setEditable( false );

t2.setEditable( false );

t3.setEditable( false );

t4.setEditable( false );

t5.setEditable( false );

responsePanel.setLayout(new GridLayout(5,1));

responsePanel.add(t1);

responsePanel.add(t2);

responsePanel.add(t3);

responsePanel.add(t4);

responsePanel.add(t5);

questionPanel.setLayout(new GridLayout(4,1));

questionPanel.add(label1);

questionPanel.add(q1);

questionPanel.add(q2);

questionPanel.add(q3);

centerPanel.add(buttonPanel,BorderLayout.CENTER);

centerPanel.add(responsePanel,BorderLayout.EAST);

container.add(centerPanel,BorderLayout.WEST);

container.add(questionPanel,BorderLayout.NORTH);

q1.addActionListener(

new ActionListener(){

public void actionPerformed( ActionEvent e )

{//actionPerformed of all registered listeners

if (e.getSource() == b1) {

que1[0] = Integer.parseInt(t1.getText()) + 1;

String temp1 = String.valueOf(que1[0]);

t1.setText(temp1);

}

else if (e.getSource() == b2){

que1[1] = Integer.parseInt(t2.getText()) + 1;

String temp2 = String.valueOf(que1[1]);

t2.setText(temp2);

}

else if (e.getSource() == b3){

que1[2] = Integer.parseInt(t3.getText()) + 1;

String temp3 = String.valueOf(que1[2]);

t3.setText(temp3);

}

else if (e.getSource() == b4){

que1[3] = Integer.parseInt(t4.getText()) + 1;

String temp4 = String.valueOf(que1[3]);

t4.setText(temp4);

}

else if (e.getSource() == b5){

que1[4] = Integer.parseInt(t5.getText()) + 1;

String temp5 = String.valueOf(que1[4]);

t5.setText(temp5);

}

} //end action performed

}

);

q2.addActionListener(

new ActionListener(){

public void actionPerformed( ActionEvent e )

{//actionPerformed of all registered listeners

if (e.getSource() == b1) {

que2[0] = Integer.parseInt(t1.getText()) + 1;

String temp6 = String.valueOf(que2[0]);

t1.setText(temp1);

}

else if (e.getSource() == b2){

que2[1] = Integer.parseInt(t2.getText()) + 1;

String temp7 = String.valueOf(que2[1]);

t2.setText(temp7);

}

else if (e.getSource() == b3){

que2[2] = Integer.parseInt(t3.getText()) + 1;

String temp8 = String.valueOf(que2[2]);

t3.setText(temp8);

}

else if (e.getSource() == b4){

que2[3] = Integer.parseInt(t4.getText()) + 1;

String temp9 = String.valueOf(que2[3]);

t4.setText(temp9);

}

else if (e.getSource() == b5){

que2[4] = Integer.parseInt(t5.getText()) + 1;

String temp10 = String.valueOf(que2[4]);

t5.setText(temp10);

}

} //end action performed

}

);

q3.addActionListener(

new ActionListener(){

public void actionPerformed( ActionEvent e )

{//actionPerformed of all registered listeners

if (e.getSource() == b1) {

que3[0] = Integer.parseInt(t1.getText()) + 1;

String temp11 = String.valueOf(que3[0]);

t1.setText(temp11);

}

else if (e.getSource() == b2){

que3[1] = Integer.parseInt(t2.getText()) + 1;

String temp12 = String.valueOf(que3[1]);

t2.setText(temp12);

}

else if (e.getSource() == b3){

que3[2] = Integer.parseInt(t3.getText()) + 1;

String temp13 = String.valueOf(que3[2]);

t3.setText(temp13);

}

else if (e.getSource() == b4){

que3[3] = Integer.parseInt(t4.getText()) + 1;

String temp14 = String.valueOf(que3[3]);

t4.setText(temp14);

}

else if (e.getSource() == b5){

que3[4] = Integer.parseInt(t5.getText()) + 1;

String temp15 = String.valueOf(que3[4]);

t5.setText(temp15);

}

} //end action performed

}

);

}//end constructor test

public void itemStateChanged(ItemEvent item) {

//int state = item.getStateChange();

//if (q1 == item.SELECTED)

{

}}

public class ButtonPanel extends JPanel

{

public ButtonPanel()

{

}

}

public class CenterPanel extends JPanel

{

public CenterPanel()

{

}

}

public class QuestionPanel extends JPanel

{

public QuestionPanel()

{

}

}

public class ResponsePanel extends JPanel

{

public ResponsePanel()

{

}

}

public static void main(String [] args)

{

test surveyFrame = new test("Student Survey") ;

surveyFrame.setSize( 500,300 );

surveyFrame.setVisible(true);

surveyFrame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);

}//end main

}//end class test

[7541 byte] By [ono45a] at [2007-10-2 19:32:20]
# 1

> I dont how to corr. Please help!! and thank you very

> much!!

>

Assuming "corr" means correct, then what is it that needs correcting? If you are getting an error, please post the full, exact error message. Please post code using the [code] tags. There's a code button when you create your post.

atmguya at 2007-7-13 21:19:57 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

is not abstract and does not override abstract method actionPerformed

Oh, I see that the title of your post is an error message? Ok. Well, the test class is declared as implementing an ActionListener. That means the test class must have an actionPerformed() method. Your test class apparently does not.

It does not appear that the test class needs to implement ActionListener. You are using annonymous classes as listeners.

atmguya at 2007-7-13 21:19:57 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...