At 10:12 AM 4/13/99 -0300, John Sproull wrote:
>
> I know this has been dealt with before, but here goes.. I am drawing
>vector information to a JPanel and want to print it in a higher dpi than
>72, but I am having no luck with the Java2D printing stuff. Is there a way
>to print this at a higher resolution? it is very possible to 'stretch' the
>data so it is physically bigger, but at 72dpi, it would just be cut off
>(to my understanding) anyone know? thanks!
>
> John Sproull
Hi John,
Swing components use double-buffering by
default. If you just use paint() to print the
component, what you'll get is the 72 dpi
offscreen buffer, faithfully reproduced on
your 300 dpi or 600 dpi printer.
The trick is to disable double buffering
when you're printing, just before you
call paint(). Here's an example that
demonstrates the technique:
ftp://ftp.ora.com/published/oreilly/java/java2d/examples/ComponentPrintable.
java
I hope this helps.
Jonathan
Java 2D Graphics: http://www.oreilly.com/catalog/java2d/
Java Cryptography: http://www.oreilly.com/catalog/javacrypt/
Bite-Size Java: http://java.oreilly.com/news/knudsen/
O'Reilly's Java Center: http://java.oreilly.com/
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/