This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Print to File

 
Brigit Ananya
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic