Hi,
I'm completely new at printing (to a printer!) from
Java, and have a couple of questions. I spent yesterday wading through tutorials and the like, which was relatively successful, in that I managed to print what I was trying to print.
I'm trying to print a component of my own, and I've simply made it Printable, and added the print() method. I play around with the Graphics object of the component a bit, to make it fit on one page, and it works just fine. I've only used the AWT stuff, but I saw one reference to the Swing libraries, which was someone advising that
you should avoid the AWT libraries, and use Swing instead.
I've looked at Swing, and can't see how I go about actually using it to print something, it all seems to be support-type classes and methods, but maybe I'm missing something. Does anyone have any general printing advice (or just point me towards some documentation - although I've probably seen it!)
My second question, which might be answered as part of the above, is how do I set my default paper size in the Print dialog? It defaults to Letter, but, being in the UK, I'd like it to default to A4. I'm sure that there should be some way of pulling that default from the printer, or from regional settings somewhere, but haven't found anything - perhaps that's in the Swing stuff?
Any general printing help would be much appreciated!
David.
[ March 07, 2006: Message edited by: David Payne ]