Click to See Complete Forum and Search --> : JLabel font size issues


jolin
07-05-2010, 07:01 AM
I want to know how to set JLabel font size. this should be very simple questions and I google it, then use jUserName.setFont(new Font("Serif", Font.BOLD, 11)) but it has not any effect.

I use the example from http://www.javarmi.com/2010/07/set-jlabel-font-size-and-color/

sohguanh
07-05-2010, 09:19 PM
I want to know how to set JLabel font size. this should be very simple questions and I google it, then use jUserName.setFont(new Font("Serif", Font.BOLD, 11)) but it has not any effect.

I use the example from http://www.javarmi.com/2010/07/set-jlabel-font-size-and-color/

Are you developing on Windows or Linux or other OSes ? From what I know, you need to have those fonts installed on that OS before you can see the effect. In Windows however, most default fonts come pre-installed with the OS so you use it readily. For Linux and others, you may need to install additional fonts to their respective OSes. Lastly, Linux, Unix variants are not so well known for GUI aspects but I think such concept is changing again nowadays.