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/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
.



Relevant Pages

  • Re: Fixed size font
    ... > Mary Walker wrote: ... >> I would like to draw a string to a panel using the Graphics object ... I need a fix sized font where all the characters are ...
    (comp.lang.java.gui)
  • Fixed size font
    ... I would like to draw a string to a panel using the Graphics object i.e ... but I would like to be able to wrap a long ... I need a fix sized font where all the characters are the same ...
    (comp.lang.java.gui)