-
Bug
-
Resolution: Fixed
-
P2
-
6u10
-
b89
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2191275 | 6u21 | Pavel Porvatov | P2 | Closed | Fixed | b03 |
JDK-2194431 | OpenJDK6 | Pavel Porvatov | P3 | Resolved | Fixed | b20 |
Consider this small program:
import java.awt.*;
import java.io.*;
import java.io.PrintWriter;
import java.net.*;
import java.util.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
public class test
{
public static void main (String args[])
{
String test="<HTML><TITLE>Test</TITLE><BODY><IMG id=test></BODY></HTML>";
HTMLEditorKit c = new HTMLEditorKit();
HTMLDocument doc = new HTMLDocument();
try {
c.read(new StringReader(test), doc, 0);
} catch (IOException e) {
System.out.println("Failed Unexpected IOException " + e);
} catch (BadLocationException e) {
System.out.println("Failed Unexpected BadLocationException " + e);
} catch (RuntimeException e) {
System.out.println("Failed Unexpected RuntimeException " + e);
}
Element elem = doc.getElement("test");
ImageView iv = new ImageView(elem);
if (!(iv.getLoadingImageIcon()!=null)){
System.out.println(" Failed Method getLoadingImageIcon.");
}else {
System.out.println(" Passed Method getLoadingImageIcon.");}
if (!(iv.getNoImageIcon()!=null)){
System.out.println(" Failed Method getNoImageIcon.");
}else {
System.out.println(" Passed Method getNoImageIcon."); }
}
}
When run with nimbus l&f it gives wrong results:
/export/jdk/jdk1.6.0_18/bin/java -cp . -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel test
Failed Method getLoadingImageIcon.
Failed Method getNoImageIcon.
/export/jdk/jdk1.6.0_10/bin/java -cp . test
Passed Method getLoadingImageIcon.
Passed Method getNoImageIcon.
According to http://java.sun.com/javase/6/docs/api/javax/swing/text/html/ImageView.html
getNoImageIcon()
Returns the icon to use if the image couldn't be found.
getLoadingImageIcon()
Returns the icon to use while in the process of loading the image.
import java.awt.*;
import java.io.*;
import java.io.PrintWriter;
import java.net.*;
import java.util.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
public class test
{
public static void main (String args[])
{
String test="<HTML><TITLE>Test</TITLE><BODY><IMG id=test></BODY></HTML>";
HTMLEditorKit c = new HTMLEditorKit();
HTMLDocument doc = new HTMLDocument();
try {
c.read(new StringReader(test), doc, 0);
} catch (IOException e) {
System.out.println("Failed Unexpected IOException " + e);
} catch (BadLocationException e) {
System.out.println("Failed Unexpected BadLocationException " + e);
} catch (RuntimeException e) {
System.out.println("Failed Unexpected RuntimeException " + e);
}
Element elem = doc.getElement("test");
ImageView iv = new ImageView(elem);
if (!(iv.getLoadingImageIcon()!=null)){
System.out.println(" Failed Method getLoadingImageIcon.");
}else {
System.out.println(" Passed Method getLoadingImageIcon.");}
if (!(iv.getNoImageIcon()!=null)){
System.out.println(" Failed Method getNoImageIcon.");
}else {
System.out.println(" Passed Method getNoImageIcon."); }
}
}
When run with nimbus l&f it gives wrong results:
/export/jdk/jdk1.6.0_18/bin/java -cp . -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel test
Failed Method getLoadingImageIcon.
Failed Method getNoImageIcon.
/export/jdk/jdk1.6.0_10/bin/java -cp . test
Passed Method getLoadingImageIcon.
Passed Method getNoImageIcon.
According to http://java.sun.com/javase/6/docs/api/javax/swing/text/html/ImageView.html
getNoImageIcon()
Returns the icon to use if the image couldn't be found.
getLoadingImageIcon()
Returns the icon to use while in the process of loading the image.
- backported by
-
JDK-2194431 NIMBUS: ImageView getNoImageIcon and getLoadingImageIcon returns nulls instead of an icon
- Resolved
-
JDK-2191275 NIMBUS: ImageView getNoImageIcon and getLoadingImageIcon returns nulls instead of an icon
- Closed
- relates to
-
JDK-6960808 OpenJDK 6 Nimbus build failure
- Resolved