-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
7
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Microsoft Windows [Version 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
Spacing is incorrect printing Arial 8pt on Windows.
REGRESSION. Last worked in version 5.0
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile, run, select printer and print.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
printing printing printing
ACTUAL -
printingprintingprinting
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package test;
import java.awt.*;
import java.awt.print.*;
import javax.swing.*;
public class PrintLabel extends JLabel implements Printable {
public PrintLabel() {
// Spacing is incorrect printing Arial 8pt on Windows.
setFont(new Font("Arial", Font.PLAIN, 8));
setText("printing printing printing");
setBounds(10, 10, 200, 10);
PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setPrintable(this);
if (printJob.printDialog()) {
try {
printJob.print();
System.exit(0);
} catch (Exception PrintException) {
PrintException.printStackTrace();
}
}
}
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
if (pageIndex == 0) {
paint(graphics);
return Printable.PAGE_EXISTS;
}
return Printable.NO_SUCH_PAGE;
}
public static void main(String [] args) {
new PrintLabel();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Unknown
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Microsoft Windows [Version 6.1.7600]
A DESCRIPTION OF THE PROBLEM :
Spacing is incorrect printing Arial 8pt on Windows.
REGRESSION. Last worked in version 5.0
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile, run, select printer and print.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
printing printing printing
ACTUAL -
printingprintingprinting
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package test;
import java.awt.*;
import java.awt.print.*;
import javax.swing.*;
public class PrintLabel extends JLabel implements Printable {
public PrintLabel() {
// Spacing is incorrect printing Arial 8pt on Windows.
setFont(new Font("Arial", Font.PLAIN, 8));
setText("printing printing printing");
setBounds(10, 10, 200, 10);
PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setPrintable(this);
if (printJob.printDialog()) {
try {
printJob.print();
System.exit(0);
} catch (Exception PrintException) {
PrintException.printStackTrace();
}
}
}
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
if (pageIndex == 0) {
paint(graphics);
return Printable.PAGE_EXISTS;
}
return Printable.NO_SUCH_PAGE;
}
public static void main(String [] args) {
new PrintLabel();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Unknown
- duplicates
-
JDK-6784965 Printing JTable using Sans Serif 11pt is broken
- Open