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

The use of SwingNode containing a JButton interacts badly with the rendering

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • FX 8 b115

      At first there's SceneBuilder 2 that is hit by the use of SwingNode: as soon as you drop a SwingNode taken from the Library onto the Content it becomes impossible to exit from SceneBuilder, the window goes away but the process remains. It is logged as DTL-5861.

      I created a very small FX app where in the FXML we read this:

      <AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplicationswingnode.FXMLDocumentController">
          <children>
              <Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" />
              <Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" />
              <SwingNode>
                <content>
                  <JButton text="This is a JButton" />
                </content>
              </SwingNode>
          </children>
      </AnchorPane>

      When trying to run such an app (Mac + FX 8 b115) nothing will ever come up. Apparently the FXMLLoader does its part of the job but no rendering is done.

      Then I've put as VM option -Djavafx.pulseLogger=true and this is enough to get the application running correctly, and with the process properly dying at exit time.
      I suspect the activation of the debug traces slows the picture enough so that the rendering becomes correct.
      I cannot be sure the issue seen with the small app is the same than the one that hist SceneBuilder 2: both use the a SwingNode containing a JButton.

      The impact on SceneBuilder 2 occurs on all platform (MAc, Win, Linux); I ran the small app only on Mac.

            fheidric Felipe Heidrich (Inactive)
            yjoan Yves Joan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: