hi all .....i've got a problem whlie executing this frame based application ....please resolve it ...
//CheckDemo.java
import java.awt.*;
import java.awt.event.*;
class CheckBox extends Frame
{
Checkbox cb1,cb2,cb3;
Label l1;
Check()
{
setTitle("CHECKBOX DEMO");
setSize(300,300);
FlowLayout fl=new FlowLayout();
setLayout(fl);
// create the components
cb1=new Checkbox("java");
cb2=new Checkbox(".NET");
cb3=new Checkbox("CLOUD COMPUTING");
l1=new Label("YOUR SELECTED COURSE");
//ADD COMPONENTS TO CONTAINER
add(cb1);add(cb2);add(cb3);add(l1);
//registration process
Sathya so=new Sathya();
cb1.addItemListener(so);
cb2.addItemListener(so);
cb3.addItemListener(so);
setVisible (true);
}//check()
class Sathya implements ItemListener
{
public void itemStateChanged(ItemEvent ie)
{
if (ie.getSource()==cb1)
{
if(cb1.getState())
{
l1.setText("your selected course:"+cb1.getLabel());
}
if(cb2.getState())
{
l1.setText("your selected course:"+cb2.getLabel());
}
if(cb3.getState())
{
l1.setText("your selected course:"+cb3.getLabel());
}
else
{
l1.setText("your selected course=none");
}//else
}//isc
}//sathya
}//check
class CheckDemo1
{
public static void main (
String [] args)
{
Check co= new Check();
}
}
}
it is showing that
java 11:error invalid method declaration; return type required Check()
please look into that once.