JavaFX 2.0 Toolbar FXML
Domanda
Q: Help me identify what's causing the error, and hopefully getting the toolbar to work.
I'm trying to take the FXML-version from this page: Difference in my java-class from link1:
- It's not a main-class.
- It does not extend Application but HBox or anything if it would work.
- Error message: "javafx.fxml.LoadException: javafx.fxml.JavaFXBuilder$ObjectBuilder does not have a default property."
Well, here the class is:
public class MainWindow implements 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")); }
}
Soluzione
The author of the tutorial you are referencing, mentions the error and provides solution to it in his next post/tutorial. See ToolBar in FXML No Longer Requires tag. I think you are facing the same problem.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow