-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
beta
-
x86
-
windows_2000
Name: stC104175 Date: 07/19/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
Here's a simplified version of my source that produces the problem. The actual
UI for my program involves adding multiple panels (one of which is a
JSplitPane) into a "main" panel that is added to a JDesktopPane. When I add a
JInternalFrame to the same JDesktopPane, the program terminates with a NPE
(shown below.)
----------------------------------------
import javax.swing.*;
public class MyApp
{
public static void main(String[] args)
{
JFrame frame = new JFrame();
JDesktopPane desktopPane = new JDesktopPane();
frame.setContentPane(desktopPane);
JInternalFrame internalFrame = new JInternalFrame();
desktopPane.add(internalFrame);
internalFrame.setVisible(true);
desktopPane.add(new JSplitPane());
}
}
----------------------------------
Here's the result:
Exception in thread "main" java.lang.NullPointerException: peer
at sun.awt.windows.WCanvasPeer.create(Native Method)
at sun.awt.windows.WComponentPeer.<init>(Unknown Source)
at sun.awt.windows.WCanvasPeer.<init>(Unknown Source)
at sun.awt.windows.WToolkit.createCanvas(Unknown Source)
at java.awt.Canvas.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addImpl(Unknown Source)
at javax.swing.JLayeredPane.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at MyApp.main(MyApp.java:16)
(Review ID: 107345)
======================================================================