Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.java.* > Newsgroup comp.lang.java.gui

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-26-2005, 10:08 PM
Mary Walker
Guest
 
Posts: n/a
Default Fixed size font

Hi,

I would like to draw a string to a panel using the Graphics object (g) i.e
g.drawString("Test",150,150); but I would like to be able to wrap a long
string around the width of the panel (a bit like a word processor would).
For this, I need a fix sized font where all the characters are the same
width. However, the font set seems limitted and I have had no joy getting
access to a fix sized font.

Any ideas?

Regards,

Mary,


Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 07-26-2005, 10:27 PM
Andrew Thompson
Guest
 
Posts: n/a
Default Re: Fixed size font

On Tue, 26 Jul 2005 23:08:22 +0100, Mary Walker wrote:

> ..However, the font set seems limitted and I have had no joy getting
> access to a fix sized font.
>
> Any ideas?


Did you try each of the 'names' listed in this constructor?
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Font.html#Font(java.lang.String,%20int,%20int)>

If that is not ..giving you joy, you might try
describing your code more precisely, vis.
<http://www.physci.org/codes/sscce.jsp>

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Presented in BC [Brain Control] Where Available
Reply With Quote
  #3 (permalink)  
Old 07-26-2005, 10:31 PM
Andrew Thompson
Guest
 
Posts: n/a
Default Re: Fixed size font

On Tue, 26 Jul 2005 22:27:25 GMT, Andrew Thompson wrote:

> On Tue, 26 Jul 2005 23:08:22 +0100, Mary Walker wrote:
>
>> ..However, the font set seems limitted and I have had no joy getting
>> access to a fix sized font.
>>
>> Any ideas?

>
> Did you try each of the 'names' listed in this constructor?
> <http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Font.html#Font(java.lang.String,%20int,%20int)>


Or to put that another way..
<http://www.javasaver.com/sb/01/index.jsp?saver=humanrights>
(requires 1.5 ..probably)

...read the page carefully. ;-)

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Too Hot For Radio
Reply With Quote
  #4 (permalink)  
Old 07-27-2005, 08:05 AM
Thomas Weidenfeller
Guest
 
Posts: n/a
Default Re: Fixed size font

Mary Walker wrote:
> I would like to draw a string to a panel using the Graphics object (g) i.e
> g.drawString("Test",150,150); but I would like to be able to wrap a long
> string around the width of the panel (a bit like a word processor would).
> For this, I need a fix sized font where all the characters are the same
> width. However, the font set seems limitted and I have had no joy getting
> access to a fix sized font.


new Font("Monospaced", PLAIN, 10)

Please see the API documentation for details.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/
Reply With Quote
  #5 (permalink)  
Old 07-28-2005, 03:42 PM
Mary Walker
Guest
 
Posts: n/a
Default Re: Fixed size font


"Thomas Weidenfeller" <nobody@ericsson.invalid> wrote in message
news:dc7f91$h57$1@news.al.sw.ericsson.se...
> Mary Walker wrote:
>> I would like to draw a string to a panel using the Graphics object (g)
>> i.e g.drawString("Test",150,150); but I would like to be able to wrap a
>> long string around the width of the panel (a bit like a word processor
>> would). For this, I need a fix sized font where all the characters are
>> the same width. However, the font set seems limitted and I have had no
>> joy getting access to a fix sized font.

>
> new Font("Monospaced", PLAIN, 10)
>
> Please see the API documentation for details.
>
> /Thomas
> --
> The comp.lang.java.gui FAQ:
> ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
> http://www.uni-giessen.de/faq/archiv....java.gui.faq/


Thanks. That worked fine,

regards,

Mary


Reply With Quote
 
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Another Sudoku Solver: mostly datastep and macro(Long) John Gerlach Newsgroup comp.soft-sys.sas 0 05-12-2006 04:40 PM
Another Sudoku Solver: mostly datastep and macro(Long) T J Newsgroup comp.soft-sys.sas 0 05-12-2006 04:18 PM
Re: Controlling font size when going from SAS Graph to MS Word Jonas Bilenas Newsgroup comp.soft-sys.sas 0 08-05-2005 02:13 PM
Controlling font size when going from SAS Graph to MS Word BruceBrad@iname.com Newsgroup comp.soft-sys.sas 0 08-04-2005 03:46 AM
font size in GIF output Arjen Raateland Newsgroup comp.soft-sys.sas 1 06-29-2005 01:20 PM



All times are GMT. The time now is 02:54 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.