| Author |
problem in printing to file (JSE 6)
|
Luca Adamo
Greenhorn
Joined: Oct 10, 2009
Posts: 8
|
|
Hi,
I tried using printing support in JTextComponent, as provided in Java SE 6.
The code I used is really simple:
I actually took this from a tutorial (http://java.sun.com/docs/books/tutorial/uiswing/misc/printtext.html)
This works fine if I print to an actual printer (on paper :P ): a dialog is shown I can choose options etc. But if i choose the provided option of printing to file it doesn't work: i can choose the directory and the name for the file, it looks like everything is working fine but no file is created. No exception is thrown and the print method return true.
Anyone tried using this method to print?
Thanks
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
Strange.
I tried out the example code, and I got an out.prn file successfully created on my desktop.
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Luca Adamo
Greenhorn
Joined: Oct 10, 2009
Posts: 8
|
|
Thanks for you answer!
I think I'm supposed to get a ps file, since the default name is out.ps. Maybe that's beacause I'm working on a mac... What are you using?
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
Possibly.
I am on WinXP
|
 |
 |
|
|
subject: problem in printing to file (JSE 6)
|
|
|