change text color in joptionpane

71

change text color in joptionpane -

import java.awt.*;
import javax.swing.*;

public class SetColor {
	public static void main(String[] args) {
		UIManager um = new UIManager();
		um.put("OptionPane.messageForeground", Color.red);
		um.put("Panel.background", Color.yellow);
		JOptionPane.showMessageDialog(null,"Hello","Set Color",
				JOptionPane.INFORMATION_MESSAGE);
	}
}

Comments

Submit
0 Comments