my dog learned polymorphism*
The moose likes Java in General and the fly likes Print to File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Print to File" Watch "Print to File" New topic
Author

Print to File

Brigit Ananya
Greenhorn

Joined: Nov 19, 2006
Posts: 2
I have 2 questions about print to file with java.awt:

1) With Java 1.4, when I use setFileName in the JobAttributes class, as soon as the user clicks on Print to File, this file name shows.
However, with Java 1.5, this file name does not show, a different file name shows. The reason why I want my file name to show is that I need a specific extension.

2) With Java 1.4, if in the window that comes up after clicking on Print to File, the user selects a specific directory where to save the file, the next time the user does a Print to File, the same directory comes up.
However, with Java 1.5, the selected directory is not remembered.

I do need to use java.awt, I cannot use javax.swing, because for printing to the printer, I need to call my own paint. Also, I need to use Java 1.5.

Please help, especially for question 1)

Thanks a lot!
Brigit Ananya
Greenhorn

Joined: Nov 19, 2006
Posts: 2
The main problem was that the file name that I set in the JobAttributes class does not show in Java1.5, although it does show in Java 1.4.

For being able to see the file name should I just use:
FileDialog fileDialog = new FileDialog(frame, "out.eps", FileDialog.SAVE)
and where would I have to put this fileDialog?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Print to File
 
Similar Threads
Scanning/Storing a String that the user enters?
NX: Random Access File, byte buffer
Which exam to take ?
JFileChooser problem
Java version in build file