Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010
    Posts
    80
    Rep Power
    0

    Default Changing the font size in java GUI

    The problem basically is when I change the font size in Display Properties (specifically in Control Panel) the font in the GUI does not change.

    The following steps give more explanation about the problem:

    1.
    I changed the font size of the system.


    2. After the font has been changed:

    As you see in the picture:
    the change happened to number 1 (The title of the GUI) but nothing happened to number 2 (File - Type Definition - ... etc).

    My question is Is there any way to fix this problem in Java (adding some code , ... ) ?

    Thanks

  2. #2
    camickr is online now Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Changing the font size in java GUI

    1) The titlebar Is actually a Windows component. Swing components are just displayed in a native OS frame. So I guess the native frame which is displaying the native titlebar is aware of the font size.

    2) These are Swing components. The Font properties of each component are controlled by the UIManager. They are not aware of the OS font settings. You would need to manually loop through the UIManager to change the Font size of each individual component. I don't know how to query the OS to determine the font size setting.

Similar Threads

  1. how can I change font size?
    By rippon in forum AWT / Swing
    Replies: 6
    Last Post: 11-10-2011, 02:42 PM
  2. Changing the font of Message box
    By venkateshcoolmoon in forum AWT / Swing
    Replies: 2
    Last Post: 03-16-2010, 05:18 AM
  3. Changing println font color
    By xcallmejudasx in forum New To Java
    Replies: 4
    Last Post: 05-21-2009, 04:05 PM
  4. changing font size
    By diggitydoggz in forum New To Java
    Replies: 1
    Last Post: 12-25-2008, 07:48 AM
  5. how to set font size for a xml value
    By bala_kj in forum Advanced Java
    Replies: 3
    Last Post: 04-01-2008, 11:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •