yes naveen ,all components inherit everything from Component class.A Label can generate MouseEvent,MouseMotionEvent etc.
Here's an example
import java.awt.*;
import java.awt.event.*;
class label extends Frame{ Label l;
label(){ setLayout(new FlowLayout());
l=new Label("come as you are");
l.setBackground(Color.pink);
add(l);
setSize(300,300);
setVisible(true);
}
public static void main(String s[]){
final label e=new label();
e.l.addMouseListener(new MouseAdapter(){
public void mouseEntered(MouseEvent d){
e.l.setText("as you were");}
public void mouseExited(MouseEvent d){
e.l.setText("as i want you to be");
} });
}
}
Not only this you can use paint method to all of the components as well.You can draw a small circle or an image on a
Button,on a Label,on a CheckBox etc etc.
That's why I'm confused in the case of CheckboxMenuItem which 'is a' MenuItem basically.so if a MenuItem can generate a
ActionEvent why CheckboxMenuItem can't ??....
[This message has been edited by Nasir Khan (edited December 20, 2000).]