Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8116422

NPE from PopupWindow.show() on application startup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Withdrawn
    • Icon: P4 P4
    • None
    • 7u6
    • javafx
    • Windows

      Run the following code:

      public class PopupWindowNPE extends Application
      {
          @Override
          public void start(final Stage stage) throws Exception
          {
              stage.show();

              PopupWindow p = new PopupWindow() {};
              p.setX(100);
              p.setY(100);
              p.setWidth(320);
              p.setHeight(240);
              p.show(stage, 100, 100);
          }

          public static void main(String[] args)
          {
              launch(args);
          }
      }

      It results in the following exceptions thrown:

      Exception in runnable
      java.lang.NullPointerException
      at com.sun.javafx.tk.quantum.GlassScene.sceneChanged(GlassScene.java:263)
      at com.sun.javafx.tk.quantum.ViewScene.sceneChanged(ViewScene.java:156)
      at com.sun.javafx.tk.quantum.PopupScene.sceneChanged(PopupScene.java:30)
      at com.sun.javafx.tk.quantum.GlassScene.setGlassStage(GlassScene.java:165)
      at com.sun.javafx.tk.quantum.ViewScene.setGlassStage(ViewScene.java:69)
      at com.sun.javafx.tk.quantum.PopupScene.setGlassStage(PopupScene.java:17)
      at com.sun.javafx.tk.quantum.PopupStage.createTKScene(PopupStage.java:62)
      at javafx.scene.Scene.impl_initPeer(Scene.java:625)
      at javafx.stage.Window$10.invalidated(Window.java:714)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:129)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:163)
      at javafx.stage.Window.setShowing(Window.java:778)
      at javafx.stage.Window.show(Window.java:793)
      at javafx.stage.PopupWindow.show(PopupWindow.java:268)
      at javafx.stage.PopupWindow.show(PopupWindow.java:316)
      at temp.PopupWindowNPE$1.run(PopupWindowNPE.java:28)
      at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:141)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
      at java.lang.Thread.run(Thread.java:722)
      java.lang.NullPointerException
      at com.sun.javafx.binding.ExpressionHelper.removeListener(ExpressionHelper.java:93)
      at javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl.removeListener(ReadOnlyBooleanWrapper.java:193)
      at javafx.stage.PopupWindow.unbindOwnerFocusedProperty(PopupWindow.java:483)
      at javafx.stage.PopupWindow.impl_visibleChanged(PopupWindow.java:377)
      at javafx.stage.Window$10.invalidated(Window.java:763)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:129)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:163)
      at javafx.stage.Window.setShowing(Window.java:778)
      at javafx.stage.Window.hide(Window.java:803)
      at javafx.stage.PopupWindow.hide(PopupWindow.java:329)
      at com.sun.javafx.stage.WindowPeerListener.closed(WindowPeerListener.java:89)
      at com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:68)
      at com.sun.glass.ui.Window.handleWindowEvent(Window.java:1004)
      at com.sun.glass.ui.Window.notifyDestroy(Window.java:919)
      at com.sun.glass.ui.win.WinWindow._close(Native Method)
      at com.sun.glass.ui.Window.close(Window.java:221)
      at com.sun.javafx.tk.quantum.WindowStage.close(WindowStage.java:573)
      at javafx.stage.Window$10.invalidated(Window.java:757)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:129)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:163)
      at javafx.stage.Window.setShowing(Window.java:778)
      at javafx.stage.Window.hide(Window.java:803)
      at com.sun.javafx.stage.WindowCloseRequestHandler.dispatchBubblingEvent(WindowCloseRequestHandler.java:45)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
      at javafx.event.Event.fireEvent(Event.java:171)
      at com.sun.javafx.stage.WindowPeerListener.closing(WindowPeerListener.java:82)
      at com.sun.javafx.tk.quantum.GlassWindowEventHandler.handleWindowEvent(GlassWindowEventHandler.java:71)
      at com.sun.glass.ui.Window.handleWindowEvent(Window.java:1004)
      at com.sun.glass.ui.Window.notifyClose(Window.java:910)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
      at java.lang.Thread.run(Thread.java:722)

            jgiles Jonathan Giles
            art Artem Ananiev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: