I've seen this question posted many times in these forums, but no answers have been submitted.
Setup for a typical java print and display the cross-platform print dialog (code taken from http://www.javaworld.com/javaworld/jw-12-2000/print/listing1_code.html and modified):
import java.awt.*;
import java.awt.geom.*;
import java.awt.print.*;
public class Example1 implements Printable {
public Example1 () {
//--- Create a printerJob object
PrinterJob printJob = PrinterJob.getPrinterJob ();
//--- Set the printable class to this one since we
//--- are implementing the Printable interface
printJob.setPrintable (this);
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
//--- Show a cross-platform print dialog to the user. If the user
//--- clicks the print button, then print, otherwise
//--- cancel the print job
if (printJob.printDialog(aset)) {
try {
printJob.print();
} catch (Exception PrintException) {
PrintException.printStackTrace();
}
}
}
This will display the Java cross-platform print dialog. However, next to the Printer selection drop-down, there is a 'Properties' button. This button is always disabled. Does anyone know how to enable it? Does anyone know how to get at the printer properties via some other mechanism? FYI: clicking on this button in any other application (word, firefox, non-java apps) shows a dialog from the printer manufacturer.
TIA,
--Kevin