Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Changing Font Size in JOptionPane Title

843806Mar 11 2009 — edited Mar 12 2009
Hello people, I am trying to change the font size of a JOptionPane dialogue... I have read other posts on this matter but had no luck with the solutions given and I don't want to use HTML...

The most useful post I read about font size change in JOptionPane is http://forums.sun.com/thread.jspa?forumID=31&threadID=765742 but again the solution given in this post for the title of the dialogue didn't work for me...

My code looks like that:
Font f = new Font("dialog",Font.BOLD,14);
Font j = new Font("dialog",Font.BOLD,2);
UIManager.put("Label.font", f);
UIManager.put("Button.font", f);
UIManager.put("TitledBorder.font", j);
This code will change the font size in the main message of a JOptionPane dialog, as well as the button font size... but it doesn't work for the title...

I have also tried some other things for the title such as:
UIManager.put("InternalFrame.titleFont", myFont);
UIManager.put("ToolTip.font", myFont);
UIManager.put("Panel.font", myFont);
UIManager.put("Label.font", myFont);
etc... but to no avail...


Can anyone help me out? I just want to say that I would like to avoid creating my own JOptionPane dialogue, or to use html....

Thank you in advance for your help...

vosfi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 9 2009
Added on Mar 11 2009
9 comments
1,401 views