Reputation: 2509
In this piece of code:
//Staff
pf.setOrientation(PageFormat.LANDSCAPE);
pj.setPrintable(graphComponent);
try {
pj.print(); // This is the function in question !!
} catch (PrinterException e2) {
System.out.println(e2);
}
//Staff
The function print of the job printer, leads you to
What I want, is that I give a default name to the file (printing result) without having that prompt. How can I change that code to get that?
Upvotes: 0
Views: 82
Reputation: 2803
Assuming that your pj is a PrinterJob instance, try calling
pj.setJobName("defaultname.pdf");
Upvotes: 1