I haven't used BufferedWriter for ages, so I can't remember whether you can change Fonts.
Try: Get a list of Fonts with GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() which returns Font. Then iterate through the Font using for or for-each and System.out.println(f.getName());
That will confirm that you actually have that Font installed. I tried it a few minutes ago and I didn't have that Font, but I did have Lucida Sans Regular, Lucida Sans Typewriter Bold, and Lucida Sans Typewriter Regular.
Can you explain the problem in more detail? What does this line of code have to do with BufferedWriter? What are you trying to achieve? Do you get a compiler error? If so, please copy and paste the exact error message.
strOut = ("TOTALS REPORT FOR TOTAL RCDS WITH NO UPDATES"); Counter.write(strOut); Counter.newLine(); Counter.newLine();
I am getting no errors I just want to change the font and font size of the My program works I just want to be able to adjust the fonts on my report. ("TOTALS REPORT FOR TOTAL RCDS WITH NO UPDATES"); //just want to change text to Courier New or something font size 24 or 48 anything.
Joined: Mar 05, 2007
Ritchie can you give me an example of how you would lay that out in a class.
Thanks, I don't know how to layout your suggestion in a class
Joined: Oct 13, 2005
Joined: Oct 13, 2005
. . . and I still don't understand what Fonts have to do with BufferedWriters; it doesn't seem possible to change Fonts on BufferedWriters. The Font class is used to format text displayed on Swing (or AWT) text components which accept Fonts. See java.awt.Component.setFont() and java.awt.Graphics.setFont().
A BufferedWriter writes plain text to an output stream (for example to a text file). A plain text file contains only text characters. Those characters do not have properties like a certain font or style.
Thank you Campbell Ritchie! I've been trying to get my font list for a couple of days, and kept messing up my objects & methods - now I've got it! And learned some stuff in the process (mostly about what doesn't work, tho ...)