We would like to know how to change JLabel background and foreground color.
//from w w w. jav a2 s . c o m import java.awt.Color; import javax.swing.JLabel; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { JLabel label = new JLabel("Full Name :", JLabel.LEFT); label.setOpaque(true); label.setForeground(new Color(150, 150, 25)); label.setBackground(new Color(50, 50, 25)); JOptionPane.showMessageDialog(null, label); } }