问:帮助我确定导致错误的原因,并希望工具栏能够正常工作。
我正在尝试从此页面获取 FXML 版本:Difference in my java-class from link 1:
- 不是主班。
- 它不会扩展 Application 但 HBox 或任何可以工作的东西。
- 错误消息:“javafx.fxml.LoadException:javafx.fxml.JavaFXBuilder$ObjectBuilder 没有默认属性。”
好吧,这里的课程是:
公共类 MainWindow 实现 Initializable { private ResourceBundle rb;
final static boolean RIGHT_TO_LEFT = false; //FXML ATTRIBUTES @FXML private OverviewTab owContent; @FXML private StatisticsTab statisticsContent; @FXML private SettingsTab settingsContent; @FXML private Polygon dock_bottom; @FXML private TabPane tabpane; @FXML private Tab owTab; @FXML private Tab statisticsTab; @FXML private Tab settingsTab; @FXML private Button helpButton; @FXML private Button updateButton; @FXML private Button task; /** * Create the application. */ @Override public void initialize(URL url, ResourceBundle rb) { this.rb = rb; // Adding Swing style of custom Listener tabpane.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Tab>() { @Override public void changed(ObservableValue<? extends Tab> observableValue, Tab oldTab, Tab newTab) { if(newTab.equals(owTab)){ } } }); //statisticsContent.addListener(this); owTab.setText(rb.getString("overviewTab_headline")); statisticsTab.setText(rb.getString("statisticsTab_headline")); settingsTab.setText(rb.getString("settingsTab_headline")); }
}