在JLable上,如何做到这个效果?
------解决方案--------------------
JLabel lbl = ...
lbl.setForegroundColor(Color.black);
...
lbl.addMouseListener(new MouseAdapter(){
public void mouseEntered(MouseEvent e){
lbl.setForegroundColor(Color.red);
}
public void mouseExit(MouseEvent e){
lbl.setForegroundColor(Color.black);
}
});