Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      Win7-64

      Description

      Run the following code. The initial visible color is green but it should be red (the fill color specified on the content). When manually resizing the window, the content appears.

      import java.awt.Color;

      import javafx.application.Application;
      import javafx.embed.swing.SwingNode;
      import javafx.scene.Scene;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      import javax.swing.JPanel;
      import javax.swing.SwingUtilities;

      public class SwingNodeResizeContent extends Application {
      private SwingNode swingNode;
      private JPanel jPanel;

      @Override
      public void start(Stage stage) {
      StackPane root = new StackPane();
      root.setStyle("-fx-background-color: #00FF00;");

      swingNode = new SwingNode();
      swingNode.setStyle("-fx-background-color: #0000FF;");
      root.getChildren().add(swingNode);

      Scene scene = new Scene(root, 800, 800);
      stage.setScene(scene);
      stage.show();

      SwingUtilities.invokeLater(new Runnable() {

      @Override
      public void run() {
      jPanel = new JPanel();
      jPanel.setBackground(Color.RED);
      swingNode.setContent(jPanel);
      }
      });
      }

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ant Anton Tarasov
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: