-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b80
-
x86
-
windows_xp
FULL PRODUCT VERSION :
1.5.0_1, 1.5.0_2, 1.5.0_4
ADDITIONAL OS VERSION INFORMATION :
Microsoft WIndows XP Version 5.1.2600
A DESCRIPTION OF THE PROBLEM :
I'm seeing overlapping text and generally weird layout with a JTextPane for certain font sizes. In particular, I see the problem with an 11 point font under the Windows native look and feel. The problem does not occur with 1.4.2_08 - at least at this font size.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the supplied test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting normal text layout.
ACTUAL -
I see weird overlapping text layout.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.UIManager;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
public class JTextPaneBug {
static String text = "Now is the time for all good men to come to the aid of their country. Now is the time for all \n"+
"good men to come to the aid of their country. Now is the time for all good men to come to the aid of \n"+
"their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for \n"+
"all good men";
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e) {
e.printStackTrace(System.err);
}
JFrame f = new JFrame();
JTextPane jtp = new JTextPane();
SimpleAttributeSet sas = new SimpleAttributeSet();
sas.addAttribute(StyleConstants.FontSize,new Integer(11));
jtp.setCharacterAttributes(sas,false);
jtp.setText(text);
f.getContentPane().add(new JScrollPane(jtp));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(200,500);
f.setVisible(true);
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_10
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
1.5.0_1, 1.5.0_2, 1.5.0_4
ADDITIONAL OS VERSION INFORMATION :
Microsoft WIndows XP Version 5.1.2600
A DESCRIPTION OF THE PROBLEM :
I'm seeing overlapping text and generally weird layout with a JTextPane for certain font sizes. In particular, I see the problem with an 11 point font under the Windows native look and feel. The problem does not occur with 1.4.2_08 - at least at this font size.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the supplied test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting normal text layout.
ACTUAL -
I see weird overlapping text layout.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.UIManager;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
public class JTextPaneBug {
static String text = "Now is the time for all good men to come to the aid of their country. Now is the time for all \n"+
"good men to come to the aid of their country. Now is the time for all good men to come to the aid of \n"+
"their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for all good men to come to the aid of their country. Now is the time for \n"+
"all good men";
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e) {
e.printStackTrace(System.err);
}
JFrame f = new JFrame();
JTextPane jtp = new JTextPane();
SimpleAttributeSet sas = new SimpleAttributeSet();
sas.addAttribute(StyleConstants.FontSize,new Integer(11));
jtp.setCharacterAttributes(sas,false);
jtp.setText(text);
f.getContentPane().add(new JScrollPane(jtp));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(200,500);
f.setVisible(true);
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_10
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.