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

Scene Builder crashes when using custom control

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8u40
    • 8
    • javafx
    • None
    • Win7 x64, Java8u5 x64

      - imported custom control "UTextFld" to Scene Builder (import JAR/FXML file)
      - custom control is displayed correctly in "custom" area
      - when custom control is dragged to content area, Scene Builder freezes for some seconds, after that the Scene Builder main window is automatically closed



      fxml-file of custom control:

      <?xml version="1.0" encoding="UTF-8"?>

      <?import java.lang.*?>
      <?import javafx.scene.control.*?>
      <?import javafx.scene.layout.*?>

      <fx:root type="javafx.scene.layout.HBox" xmlns:fx="http://javafx.com/fxml">
      <Label text="Label1" />
      <Label text="Label2" />
      </fx:root>



      java-file of custom control:

      package com.unitechnik;

      import java.io.IOException;

      import javafx.fxml.*;
      import javafx.scene.control.TextField;
      import javafx.scene.layout.HBox;

      public class UTextFld extends HBox
      {
          @FXML private TextField textField;

          public UTextFld()
          {
              FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/com/unitechnik/UTextFld.fxml"));
              fxmlLoader.setRoot(this);
              fxmlLoader.setController(this);

              try {
                  fxmlLoader.load();
              } catch (IOException exception) {
                  throw new RuntimeException(exception);
              }
          }
      }

            yjoan Yves Joan (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: