-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta3
-
generic
-
windows_nt
Clicking on Print to File button still prints the output to the printer. It fails on Win32 only.
import java.awt.*;
import java.awt.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
public class CrossDialog {
public static void main(String args[]) {
PrinterJob pj = PrinterJob.getPrinterJob();
HashPrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
if (pj != null && pj.printDialog(aset)) {
pj.setPrintable(new Printable() {
public int print(Graphics g, PageFormat pf, int pgIndex) {
if (pgIndex > 0) {
return Printable.NO_SUCH_PAGE;
}
g.drawString("Printed!", (int)pf.getImageableX() + 50, (int)pf.getIm
ageableY() + 50);
return Printable.PAGE_EXISTS;
}
});
try {
pj.print(aset);
} catch (PrinterException pe) {
} finally {
}
}
System.exit(0);
}
}
import java.awt.*;
import java.awt.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
public class CrossDialog {
public static void main(String args[]) {
PrinterJob pj = PrinterJob.getPrinterJob();
HashPrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
if (pj != null && pj.printDialog(aset)) {
pj.setPrintable(new Printable() {
public int print(Graphics g, PageFormat pf, int pgIndex) {
if (pgIndex > 0) {
return Printable.NO_SUCH_PAGE;
}
g.drawString("Printed!", (int)pf.getImageableX() + 50, (int)pf.getIm
ageableY() + 50);
return Printable.PAGE_EXISTS;
}
});
try {
pj.print(aset);
} catch (PrinterException pe) {
} finally {
}
}
System.exit(0);
}
}
- relates to
-
JDK-4468322 Need APIs to support URI representing a platform path name
-
- Closed
-
-
JDK-4464134 java.net.URI should permit backslashes in opaque URIs
-
- Closed
-