Code example for JLabel

Methods: setForegroundsetIcon

0
                        color = Color.orange;
                    }else if (stringValue.toLowerCase().contains("heart attack")){
                        icon = icons.get(1);
                        color = Color.red;
                    } 
                    label.setForeground(color);
                    // Set icon to display for value 
                    if (icon != null){
                        label.setIcon(icon);
                    } 
                } 
 
		return label;
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java