Thursday, March 24, 2011

JOptionPane with bold text and different font

  1. public class abc {
  2. public static void main(String[] args) {
  3. String msg = "my name is :
    • italics abc "
    • + "
    • bold and "
    • + "
    • underlined...
    "
    ;
  4. JLabel label = new JLabel(msg);
  5. label.setFont(new Font("serif", Font.PLAIN, 14));
  6. JOptionPane.showConfirmDialog(null, label);
  7. System.exit(0);
  8. }
  9. }

1 comment: