Code example for JLabel

Methods: setForeground

0
	else { 
	  super.mouseClicked(e);
	} 
      } 
      public void mouseEntered(MouseEvent e) {
	result.setForeground(Color.RED);
      } 
      public void mouseExited(MouseEvent e) {
	result.setForeground(Color.BLUE);
      } 
    }); 
     
    return result;
  } 
} 
Connect your IDE to all the code out there  Get Codota for Java