?
Solved

Font

Posted on 2005-04-04
11
Medium Priority
?
332 Views
Last Modified: 2013-12-03
I can't get the font name right:
String header = "<html>[ Student Report Sheet ]<br>" +date.toString() + "</html>";
reportTitleLabel.setFont(  new Font(Font.getFont(header), Font.ITALIC, 16)  );
0
Comment
Question by:komlaaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 92

Expert Comment

by:objects
ID: 13695657
Try "Helvetica" for examle
0
 
LVL 37

Assisted Solution

by:zzynx
zzynx earned 200 total points
ID: 13695660
reportTitleLabel.setFont(  new Font("Verdana", Font.ITALIC, 16)  );
0
 
LVL 92

Expert Comment

by:objects
ID: 13695663
reportTitleLabel.setFont(  new Font("Helvetica", Font.ITALIC, 16)  );
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 13695666
or better still use:

reportTitleLabel.setFont(  reportTitleLabel.getFont().deriveFont(Font.ITALIC, 16)  );
0
 
LVL 14

Expert Comment

by:StillUnAware
ID: 13695675
or reportTitleLabel.setFont(  new Font(Font.getFont(header).<u>getName()</u>, Font.ITALIC, 16)  );
0
 
LVL 14

Expert Comment

by:StillUnAware
ID: 13695676
sorry underline didn't work
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13695677
If you want to use the font of another component but adapt the style + size:

reportTitleLabel.setFont( otherComponent.getFont().deriveFont(Font.ITALIC, 16) );
0
 
LVL 92

Expert Comment

by:objects
ID: 13695693
you can get more details on the deriveFont() method I posted above at:

http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Font.html#deriveFont(int, float)
0
 

Author Comment

by:komlaaa
ID: 13695756
get back to you tomorrow,... i am sleepy here ;)
0
 
LVL 92

Expert Comment

by:objects
ID: 13695758
nite :)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13704508
thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This video teaches viewers about errors in exception handling.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question