Re:How to solve this RadioButtonHandler problem?

Example of the programme:

public ColorSelect()
{
super("ColorSelect");


Container c=getContentPane();
c.setLayout(new BorderLayout());

//north
diagramaButton =new JRadioButton("Diagram A",true);
diagrambButton =new JRadioButton("Diagram B",false);

RadioButtonHandler handler=new RadioButtonHandler();
diagramaButton.addItemListener(handler);
diagrambButton.addItemListener(handler);

radioGroup=new ButtonGroup();
radioGroup.add(diagramaButton);
radioGroup.add(diagrambButton);



panel=new JPanel();
panel.add(diagramaButton);
panel.add(diagrambButton);


c.add(panel,BorderLayout.NORTH);





//south
open=new JButton("OPEN");
check=new JButton("CHECK");
panel2=new JPanel();
panel2.add(open);
panel2.add(check);
c.add(panel2,BorderLayout.SOUTH);
open.addActionListener(this);
check.addActionListener(this);


setVisible(true);
setSize(300,125);
show();
}
C:Documents and Settingsstudent18aMy DocumentsJava ProjectColorSelect.java:40: cannot resolve symbol
symbol : class RadioButtonHandler
location: class ColorSelect
RadioButtonHandler handler=new RadioButtonHandler();
^
C:Documents and Settingsstudent18aMy DocumentsJava ProjectColorSelect.java:40: cannot resolve symbol
symbol : class RadioButtonHandler
location: class ColorSelect
RadioButtonHandler handler=new RadioButtonHandler();
^
2 errors

Any solutions for solving this problem?

Comments

  • : Example of the programme:
    :
    : public ColorSelect()
    : {
    : super("ColorSelect");
    :
    :
    : Container c=getContentPane();
    : c.setLayout(new BorderLayout());
    :
    : //north
    : diagramaButton =new JRadioButton("Diagram A",true);
    : diagrambButton =new JRadioButton("Diagram B",false);
    :
    : RadioButtonHandler handler=new RadioButtonHandler();
    : diagramaButton.addItemListener(handler);
    : diagrambButton.addItemListener(handler);
    :
    : radioGroup=new ButtonGroup();
    : radioGroup.add(diagramaButton);
    : radioGroup.add(diagrambButton);
    :
    :
    :
    : panel=new JPanel();
    : panel.add(diagramaButton);
    : panel.add(diagrambButton);
    :
    :
    : c.add(panel,BorderLayout.NORTH);
    :
    :
    :
    :
    :
    : //south
    : open=new JButton("OPEN");
    : check=new JButton("CHECK");
    : panel2=new JPanel();
    : panel2.add(open);
    : panel2.add(check);
    : c.add(panel2,BorderLayout.SOUTH);
    : open.addActionListener(this);
    : check.addActionListener(this);
    :
    :
    : setVisible(true);
    : setSize(300,125);
    : show();
    : }
    : C:Documents and Settingsstudent18aMy DocumentsJava ProjectColorSelect.java:40: cannot resolve symbol
    : symbol : class RadioButtonHandler
    : location: class ColorSelect
    : RadioButtonHandler handler=new RadioButtonHandler();
    : ^
    : C:Documents and Settingsstudent18aMy DocumentsJava ProjectColorSelect.java:40: cannot resolve symbol
    : symbol : class RadioButtonHandler
    : location: class ColorSelect
    : RadioButtonHandler handler=new RadioButtonHandler();
    : ^
    : 2 errors
    :
    : Any solutions for solving this problem?
    :
    Define the RadioButtonHandler class. It is not a standard class.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion