-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: asR10047 Date: 12/19/2000
Below is a small example that demonstrates how NPE is raising from
TitledBorder.paintBorder()
-------------------------------------------------
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
public class BorderTest {
public static void main(String[] argv) {
String title = "Test";
JButton component = new JButton("Test");
TitledBorder border;
JFrame f = new JFrame("Test Frame");
f.setBounds(100, 100, 100, 100);
f.setVisible(true);
Graphics g = f.getGraphics();
border = new TitledBorder( title);
border.paintBorder(component, g, 0, 1, 2, 3);
f.dispose();
}
}
-------------------------------------------------
The following is throwing from the test:
(ans@matmech(pts/10): ~/work .220)
:\>/net/sword/export3/JDK1.4.0beta-b45/solaris/bin/java BorderTest
Exception in thread "main" java.lang.NullPointerException
at java.awt.Rectangle.setBounds(Rectangle.java:254)
at javax.swing.border.TitledBorder.paintBorder(TitledBorder.java:333)
at BorderTest.main(BorderTest.java:17)
======================================================================