Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-14-2008, 09:48 PM
Member
 
Join Date: Sep 2008
Posts: 3
kader is on a distinguished road
How to change The Font
Can anyone teach me how to change the font? Example i have codes below. How to make change the font and make it bold. I new in java. Thanks

.......
h1 =new Label("=============================> English Language Online Quiz <=============================");
add(h1);
......
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-14-2008, 10:09 PM
serjant's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Ukraine,Zaporozhye
Posts: 322
serjant is on a distinguished road
Send a message via ICQ to serjant Send a message via Skype™ to serjant
Code:
JLabel label = new JLabel("My Label"); java.awt.Font font = new java.awt.Font("Dialog",Font.BOLD,14); label.setFont(font);
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-15-2008, 06:09 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 4,564
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use TextAttribute class to change color and font of a text Java Tip java.awt 0 06-25-2008 12:33 PM
how to set font size for a xml value bala_kj Advanced Java 3 04-01-2008 01:00 PM
How to change font/ font color etc in a graphic object using JCombobox? JavaInLove AWT / Swing 0 02-07-2008 01:28 PM
JTable with Font Rama Koti Reddy AWT / Swing 1 12-12-2007 07:22 PM
Font question orchid Java 2D 1 08-01-2007 04:03 AM


All times are GMT +3. The time now is 10:20 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org