I have this:
JOptionPane.showMessageDialog(null, \" \" + company1 +
\" Has Higher A Market Value\\nThan \" + company2,
\"Informa
Use HTML
JOptionPane.showMessageDialog(null, " Has Higher A Market Value ");
If your default font doesn't support it then you can specify it like
String msg = "This is how to get:- italics and "
+ "
- bold and "
+ "
- underlined...
";
JLabel label = new JLabel(msg);
label.setFont(new Font("serif", Font.PLAIN, 14));
JOptionPane.showConfirmDialog(null, label);
Output:
