GIDForums  

Go Back   GIDForums > Computer Programming Forums > Java Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-Aug-2007, 05:49
parthu parthu is offline
New Member
 
Join Date: Aug 2007
Posts: 2
parthu is on a distinguished road
Question

Printing alphabets and numbers bold


hi all,

i have one problem that is "how to print alphabets and numbers in bold for dot matrix printer with correct alignment for usage of bill transaction. i have tried but i can't apply to strings.

please help me to overcome from this problem.
  #2  
Old 09-Nov-2007, 18:45
MonkOfox MonkOfox is offline
New Member
 
Join Date: Nov 2007
Posts: 21
MonkOfox is on a distinguished road

Re: Printing alphabets and numbers bold


Look at the 'Font' class in the java 1.5.0 API.

it has a constructor like so:

JAVA Code:

Font a = new Font("hello",BOLD,12);

// where:

// "hello" could be the string literal "hello" or a string variable with a value
// of "hello"

// BOLD is one of the many static ints provided by default to that class.

// and 12 is the actual point size of the font.





but be sure to remember that this class is in the java.awt package, so you can only use this a GUI. (i.e. in the public void paintComponent funtion).

Hope this Helps,

Justin Fox

Keep in mind that you can also do:

JAVA Code:

String a = Integer.toString(myint);

Font b = new Font(a,BOLD,12);

Last edited by LuciWiz : 11-Nov-2007 at 10:01. Reason: Please insert your Java code between [java] & [/java] tags
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 13:21.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.