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

JFXPanel IllegalComponentStateException while moving tabs in JTabbedPane

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Labels:

      Description

      For moving tabs in JTabbedPane I use code like this:

              tabbedPane.remove(jfxPanel);
              tabbedPane.insertTab(label, null, jfxPanel, tooltip, toIndex);

      And rarely get following exception:

      Exception in runnable
      java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
      at java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:2043)
      at java.awt.Component.getLocationOnScreen(Component.java:2017)
      at javafx.embed.swing.JFXPanel.sendMoveEventToFX(JFXPanel.java:394)
      at javafx.embed.swing.JFXPanel.access$600(JFXPanel.java:94)
      at javafx.embed.swing.JFXPanel$HostContainer.setEmbeddedStage(JFXPanel.java:585)
      at com.sun.javafx.tk.quantum.EmbeddedStage.<init>(EmbeddedStage.java:31)
      at com.sun.javafx.tk.quantum.QuantumToolkit.createTKEmbeddedStage(QuantumToolkit.java:460)
      at com.sun.javafx.stage.EmbeddedWindow.impl_visibleChanging(EmbeddedWindow.java:45)
      at javafx.stage.Window$13.invalidated(Window.java:660)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:88)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:122)
      at javafx.stage.Window.setShowing(Window.java:744)
      at javafx.stage.Window.show(Window.java:759)
      at com.sun.javafx.stage.EmbeddedWindow.show(EmbeddedWindow.java:36)
      at javafx.embed.swing.JFXPanel$5.run(JFXPanel.java:545)
      at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:108)
      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)

      To reproduce the bug launch attached file and click on button.

        Attachments

          Activity

            People

            • Assignee:
              asemenyuk Alexey Semenyuk
              Reporter:
              azvegint Alexander Zvegintsev (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: