Results 1 to 3 of 3
Thread: How to change The Font
- 09-14-2008, 08:48 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 3
- Rep Power
- 0
- 09-14-2008, 09:09 PM #2Java Code:
JLabel label = new JLabel("My Label"); java.awt.Font font = new java.awt.Font("Dialog",Font.BOLD,14); label.setFont(font);
- 09-15-2008, 05:09 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,370
- Blog Entries
- 1
- Rep Power
- 26
Read more about this on Java doc. First argument of the Font constructor mentioned above is font name, it can be font face name or font family name. That's point most of the time are confusing.
Similar Threads
-
How to change font/ font color etc in a graphic object using JCombobox?
By JavaInLove in forum AWT / SwingReplies: 5Last Post: 04-25-2009, 09:00 PM -
How to use TextAttribute class to change color and font of a text
By Java Tip in forum java.awtReplies: 0Last Post: 06-25-2008, 11:33 AM -
how to set font size for a xml value
By bala_kj in forum Advanced JavaReplies: 3Last Post: 04-01-2008, 12:00 PM -
JTable with Font
By Rama Koti Reddy in forum AWT / SwingReplies: 1Last Post: 12-12-2007, 06:22 PM -
Font question
By orchid in forum Java 2DReplies: 1Last Post: 08-01-2007, 03:03 AM
Bookmarks