问:帮助我确定导致错误的原因,并希望让工具栏正常工作。
我正在尝试从此页面获取FXML版本: 我的java-class与链接1的区别:
嗯,这里的课程是:
公共类MainWindow实现Initializable { 私有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"));
}
}
答案 0 :(得分:2)
您正在引用的教程的作者,在他的下一篇文章/教程中提到了错误并提供了解决方案。见ToolBar in FXML No Longer Requires tag。我认为你面临同样的问题。