Skip to content

Popup Resize #178

Description

@nyzzik

I am trying to resize a stage popup after calling WebAPI.openStageAsPopup() . I found a way to do it using javascript using window.resizeTo() however this is only working when i set it trigger on button press. If i call it after I popup the window i get this error. I have tried doing it in the JavaFX initialize method as well as setting up a window on load event listener using javascript and receive the same error. Is a way to resize the popup window?

Exception in thread "JavaFX Application Thread" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:115)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at simplefx.util.ReflectionUtil$UseReflection.applyDynamic(ReflectionUtil.scala:21)
        at com.sun.glass.ui.monocle.input.fork.NativeMouseInput.notifyMouse(NativeMouseInput.scala:335)
        at com.sun.glass.ui.monocle.input.fork.NativeMouseInput.postMouseEvent(NativeMouseInput.scala:227)
        at com.sun.glass.ui.monocle.input.fork.NativeMouseInput.setState(NativeMouseInput.scala:186)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at simplefx.util.ReflectionUtil$UseReflection.applyDynamic(ReflectionUtil.scala:21)
        at com.jpro.meta.tk.SceneInputListener.processInputInScene(SceneInputListener.scala:305)
        at com.jpro.meta.tk.SceneInputListener.processInput(SceneInputListener.scala:205)
        at com.jpro.meta.tk.SceneInputListener.processInputs(SceneInputListener.scala:132)
        at com.jpro.meta.tk.SceneInputListener.processOrRequest(SceneInputListener.scala:40)
        at com.jpro.meta.tk.SceneInputListener.$anonfun$new$4(SceneInputListener.scala:58)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at simplefx.cores.standard.parts.CoreTimeEvent$$anon$3.run(CoreTimeEvent.scala:62)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
        at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
        at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NullPointerException: Cannot invoke "com.jpro.internal.communicator.InstanceImpl.views()" because the return value of "com.jpro.WebAPIImpl$ExtendStage.instance()" is null
        at com.jpro.WebAPIImpl$WebAPIImpl.addCommand(WebAPIImpl.scala:159)
        at com.jpro.WebAPIImpl$WebAPIImpl$JS$.$anonfun$evalFuture$1(WebAPIImpl.scala:135)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at simplefx.cores.interfaces.parts.testing.CoreTesting.inFX(CoreTesting.scala:21)
        at simplefx.cores.interfaces.parts.testing.CoreTesting.inFX$(CoreTesting.scala:18)
        at simplefx.cores.standard.Core.inFX(Core.scala:9)
        at com.jpro.WebAPIImpl$WebAPIImpl$JS$.evalFuture(WebAPIImpl.scala:135)
        at com.jpro.WebAPIImpl$WebAPIImpl.executeJSAsync(WebAPIImpl.scala:504)
        at ddg51.datavac.gui.AppMenuBar$6.handle(AppMenuBar.java:219)
        at ddg51.datavac.gui.AppMenuBar$6.handle(AppMenuBar.java:1)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.control.MenuItem.fire(MenuItem.java:459)
        at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createNodeMenuItemChildren$14(ContextMenuContent.java:1437)
        at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3737)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:4042)
        at javafx.scene.Scene.processMouseEvent(Scene.java:1933)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2757)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
        at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:436)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
        at com.sun.glass.ui.View.handleMouseEvent(View.java:551)
        at com.sun.glass.ui.View.notifyMouse(View.java:937)
        at com.sun.glass.ui.monocle.MonocleView.notifyMouse(MonocleView.java:116)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 21 more

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions