-
Bug
-
Resolution: Unresolved
-
P3
-
6u10, 7, 9
-
x86
-
linux, solaris, windows_vista, windows_7
java 1.6.0_10
ADDITIONAL OS VERSION INFORMATION :
Windows Vista Business SP1
EXTRA RELEVANT SYSTEM CONFIGURATION :
Also observed on Windows XP
A DESCRIPTION OF THE PROBLEM :
When printing JTable with renderers of any kind that use the font Font.SANS_SERIF, 11pt, PLAIN, the characters in cells overlaps with each other (within the same cell)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See source code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Displayed text in cells should not overlap
ACTUAL -
In many cases, particularly with upper case characters, text in completely garbled, with characters overlapping each other
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public static void main(String[] x)
{
try
{
JTable table = new JTable(1, 1);
table.setValueAt("CURR ASSETS-CASH", 0, 0);
table.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 11));
/*text appears fine in table in option pane*/
JOptionPane.showMessageDialog(null, new JScrollPane(table));
/*text overlaps*/
table.print();
System.exit(0);
}
catch(PrinterException ex)
{
ex.printStackTrace();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
The only workaround is to use a font such as Lucida Sans or Tahoma which is somewhat similar but seems not to have the same problems when printing
Release Regression From : 6u7
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
- duplicates
-
JDK-7092205 No spacing in Printing JTextArea with some font and size
- Closed
-
JDK-8019285 Incorrect spacing when printing JTextField
- Closed
-
JDK-8019880 Characters overlapping during Print with Java 7
- Closed
-
JDK-8055867 Some characters not printed correctly in HTML text
- Closed
-
JDK-7082319 Spacing is incorrect printing Arial 8pt on Windows.
- Closed
-
JDK-6804856 Make FontMetrics used for printing public and permanent
- Closed
- relates to
-
JDK-8055867 Some characters not printed correctly in HTML text
- Closed
-
JDK-6784397 Uneven spacing when printing Monospaced font
- Open