Does anyone knows how can I set a custom Font to a JOptionPane ?? The method showMessageDialog shows the dialog, but I dont know how ca I customize the font.
The message is of type Object. If you create a JLabel and specify the font for the JLabel and then pass the JLabel as the message object, this should achieve the desired effect. Kyle
Thanks Kyle, it work!!, , but now, I have the message with a font and the buttons in the old thick ugly font ??? Do you know how to change the buttons font ?
Create a JButton for each button and change the font. Use the showOptionDialog(...) method of JOptionPane. Wrap each of your buttons in an Object[] and pass as the option paramater to this method. Kyle
Cool, just the problem I had. However, if I got \n (newlines) in the text, JLabel's aint enough, since then all the text is on one line. Suggestions to solve this?
Edit: Seems like JTextArea is the closest to the answer, although the bg color is white on that by default.. bah!
[ July 05, 2004: Message edited by: Daniel Akesson ] [ July 05, 2004: Message edited by: Daniel Akesson ]
Post by:autobot
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
a bit of art, as a gift, that will fit in a stocking