Article View: borland.public.jbuilder.java.swing
Article #10985Changing of fonts
From: Lois Neo
Date: Sat, 24 Jul 1999 00:00
Date: Sat, 24 Jul 1999 00:00
17 lines
1138 bytes
1138 bytes
Hi,
I need to apply change of font face, styles & size dynamically during run
time on a JLabel. Now I find that once a font say, "Times New Roman, PLAIN,
15" has been set before, changing to another font style, say BOLD, is not
reflected on the Text of the JLabel at all. However, if I change the font
size, the change (both style & size) is then reflected. What's wrong?
Every time I want to change the font, I call the following codes:
myLabel.setText(myText);
myLabel.setFont(new Font(fontName,fontStyle, fontSize));
myLabel.repaint();
--
Thanks for any help given
Lois
Technical Details
Message-ID:
<7na64r$p884@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,90757db6ba04624e,start X-Google-Attributes: gid111d45,public From: "Lois Neo" <slneo@cybergal.com> Subject: Changing of fonts Date: 1999/07/24 Message-ID: <7na64r$p884@forums.borland.com> X-Deja-AN: 504458441 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Reply-To: "Lois Neo" <slneo@cybergal.com> Newsgroups: borland.public.jbuilder.java.swing