-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
7
-
generic
-
generic
JDK: 7b70+
Platform: Windows, Solaris
The following simple code throws NPE:
------------------------------------------------------
import javax.swing.*;
import java.awt.*;
public class AddNotify {
public static void main(String[] args) {
new JLayer<Button>(new Button()).addNotify();
}
}
------------------------------------------------------
On Windows:
Exception in thread "main" java.lang.NullPointerException: peer
at sun.awt.windows.WButtonPeer.create(Native Method)
at sun.awt.windows.WComponentPeer.<init>(WComponentPeer.java:719)
at sun.awt.windows.WButtonPeer.<init>(WButtonPeer.java:60)
at sun.awt.windows.WToolkit.createButton(WToolkit.java:331)
at java.awt.Button.addNotify(Button.java:177)
at java.awt.Container.addNotify(Container.java:2623)
at javax.swing.JComponent.addNotify(JComponent.java:4731)
at AddNotify.main(AddNotify.java:6)
Platform: Windows, Solaris
The following simple code throws NPE:
------------------------------------------------------
import javax.swing.*;
import java.awt.*;
public class AddNotify {
public static void main(String[] args) {
new JLayer<Button>(new Button()).addNotify();
}
}
------------------------------------------------------
On Windows:
Exception in thread "main" java.lang.NullPointerException: peer
at sun.awt.windows.WButtonPeer.create(Native Method)
at sun.awt.windows.WComponentPeer.<init>(WComponentPeer.java:719)
at sun.awt.windows.WButtonPeer.<init>(WButtonPeer.java:60)
at sun.awt.windows.WToolkit.createButton(WToolkit.java:331)
at java.awt.Button.addNotify(Button.java:177)
at java.awt.Container.addNotify(Container.java:2623)
at javax.swing.JComponent.addNotify(JComponent.java:4731)
at AddNotify.main(AddNotify.java:6)
- relates to
-
JDK-6899877 JComponent.add/removeNotify() should mention that they are not supposed to be called directly
-
- Closed
-