-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.3.1
-
None
-
x86
-
solaris_7
SwingUtilities.paintComponent() takes a Component argument, so it is possible (though a pretty bad idea) for a java program to pass a heavyweight Component to paintComponent(). This was in part the cause for bug 4321847. With Kestrel (post build Y i.e. including the fix for 4321847), the following code throws a NullPointerException. With 1.4, the Button is painted over with the Frame's background color.
import javax.swing.*;
import java.awt.*;
public class otherTests {
public static void main(String argv[]) {
Button comp = new Button("Some nonsense");
Frame pn = new Frame();
pn.add(comp);
pn.setSize(200,100);
pn.setVisible(true);
Rectangle bounds = comp.getBounds();
comp.getGraphics().create(bounds.x, bounds.y, bounds.width,
bounds.height).getClipBounds();
SwingUtilities.paintComponent(comp.getGraphics(), comp, pn,
bounds.x, bounds.y, bounds.width, bounds.height);
System.out.println("OKAY");
}
}
import javax.swing.*;
import java.awt.*;
public class otherTests {
public static void main(String argv[]) {
Button comp = new Button("Some nonsense");
Frame pn = new Frame();
pn.add(comp);
pn.setSize(200,100);
pn.setVisible(true);
Rectangle bounds = comp.getBounds();
comp.getGraphics().create(bounds.x, bounds.y, bounds.width,
bounds.height).getClipBounds();
SwingUtilities.paintComponent(comp.getGraphics(), comp, pn,
bounds.x, bounds.y, bounds.width, bounds.height);
System.out.println("OKAY");
}
}
- relates to
-
JDK-4321847 SwingUtilities.paintComponent() causes the VM crash on NT
-
- Resolved
-
-
JDK-4328857 docs should says: SwingUtilities.paintComponent() supports only lightweight c
-
- Resolved
-
-
JDK-4329260 SwingUtilties.paintComponent() should check for lightweight
-
- Closed
-