-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b08
-
b07
-
x86
-
windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2144254 | 6u1 | Sergey Groznyh | P2 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
1.6.0-rc-b100
A DESCRIPTION OF THE PROBLEM :
Jeditorpane does not start up the html file. May be a problem with css? Under 1.5.0 these run fine. But under 1.6.0 sometimes I am greeted by a black dos screen.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Stack trace attached
---------- BEGIN SOURCE ----------
Java File
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
public class MyEditorPane extends JEditorPane{
private static MyEditorPane editorPane;
private MyEditorPane(){
setContentType("text/html");
final HTMLEditorKit editor =(HTMLEditorKit) this.getEditorKit();
StyleSheet styles = new StyleSheet();
editor.setStyleSheet(styles);
setEditorKit(editor);
try{
styles.importStyleSheet(
MyEditorPane.class.getResource("Html.css"));
}catch (Exception ex){
System.out.println(ex);
}
setEditable(false);
}
public static MyEditorPane getInstance() {
if (editorPane == null) {
editorPane = new MyEditorPane();
}
return editorPane;
}
public static void main(String[] args) {
final JFrame frame = new JFrame();
frame.setTitle("First");
frame.setSize(new
Dimension(Toolkit.getDefaultToolkit().getScreenSize().width,600));
MyEditorPane.getInstance();
try{
MyEditorPane.editorPane.setPage(MyEditorPane.class.getResource("./HTML.html"));
}
catch (Exception exc) {}
frame.setContentPane(MyEditorPane.editorPane);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
CSS file
p {
text-decoration:none;
text-indent:0;
font-weight:normal;
padding-top:0;
margin-top:0;
vertical-align:top;
font-style:normal;
padding-right:0;
padding-bottom:10;
font-size:18;
font-family:Verdana,Comic Sans MS,Lucida Bright,SansSerif;
padding-left:0;
margin-left:40;
color:#000000;
text-align:left;
}
h1 {
text-decoration:normal;
font-size:150%;
text-indent:0;
font-weight:bold;
padding-top:0;
margin-top:10;
margin-bottom:0;
vertical-align:top;
font-style:normal;
padding-right:0;
padding-bottom:10;
font-family:Verdana,Comic Sans MS,Lucida Bright, SansSerif;
padding-left:0;
color:#000000;
margin-left:0;
text-align:center;
margin-bottom:6;
margin-right:0;
}
hr{
margin-top:50;
margin-bottom:0;
margin-left:100;
padding-left:10;
padding-bottom:50;
color:#000000;
}
HTML file
<html>
<head>
<title>Test</title>
</head>
<body bgcolor="#FFFFFF">
<h1>Test</h1>
<blockquote>
<hr align = "center" noshade>
<p>Test
<p>Test
<p>Test
<hr noshade>
</blockquote>
</body>
</html>
---------- END SOURCE ----------
REPRODUCIBILITY :
This bug can be reproduced often.
Release Regression From : 5.0u9
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
1.6.0-rc-b100
A DESCRIPTION OF THE PROBLEM :
Jeditorpane does not start up the html file. May be a problem with css? Under 1.5.0 these run fine. But under 1.6.0 sometimes I am greeted by a black dos screen.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Stack trace attached
---------- BEGIN SOURCE ----------
Java File
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
public class MyEditorPane extends JEditorPane{
private static MyEditorPane editorPane;
private MyEditorPane(){
setContentType("text/html");
final HTMLEditorKit editor =(HTMLEditorKit) this.getEditorKit();
StyleSheet styles = new StyleSheet();
editor.setStyleSheet(styles);
setEditorKit(editor);
try{
styles.importStyleSheet(
MyEditorPane.class.getResource("Html.css"));
}catch (Exception ex){
System.out.println(ex);
}
setEditable(false);
}
public static MyEditorPane getInstance() {
if (editorPane == null) {
editorPane = new MyEditorPane();
}
return editorPane;
}
public static void main(String[] args) {
final JFrame frame = new JFrame();
frame.setTitle("First");
frame.setSize(new
Dimension(Toolkit.getDefaultToolkit().getScreenSize().width,600));
MyEditorPane.getInstance();
try{
MyEditorPane.editorPane.setPage(MyEditorPane.class.getResource("./HTML.html"));
}
catch (Exception exc) {}
frame.setContentPane(MyEditorPane.editorPane);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
CSS file
p {
text-decoration:none;
text-indent:0;
font-weight:normal;
padding-top:0;
margin-top:0;
vertical-align:top;
font-style:normal;
padding-right:0;
padding-bottom:10;
font-size:18;
font-family:Verdana,Comic Sans MS,Lucida Bright,SansSerif;
padding-left:0;
margin-left:40;
color:#000000;
text-align:left;
}
h1 {
text-decoration:normal;
font-size:150%;
text-indent:0;
font-weight:bold;
padding-top:0;
margin-top:10;
margin-bottom:0;
vertical-align:top;
font-style:normal;
padding-right:0;
padding-bottom:10;
font-family:Verdana,Comic Sans MS,Lucida Bright, SansSerif;
padding-left:0;
color:#000000;
margin-left:0;
text-align:center;
margin-bottom:6;
margin-right:0;
}
hr{
margin-top:50;
margin-bottom:0;
margin-left:100;
padding-left:10;
padding-bottom:50;
color:#000000;
}
HTML file
<html>
<head>
<title>Test</title>
</head>
<body bgcolor="#FFFFFF">
<h1>Test</h1>
<blockquote>
<hr align = "center" noshade>
<p>Test
<p>Test
<p>Test
<hr noshade>
</blockquote>
</body>
</html>
---------- END SOURCE ----------
REPRODUCIBILITY :
This bug can be reproduced often.
Release Regression From : 5.0u9
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
- backported by
-
JDK-2144254 Jeditorpane does not start up the html file
-
- Resolved
-