Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <fx:root type="javafx.scene.layout.VBox" xmlns="http://javafx.com/javafx"
- xmlns:fx="http://javafx.com/fxml" minWidth="100" minHeight="20">
- <Button text="${controller.content}" minWidth="100" minHeight="20"/>
- </fx:root>
- public class MyButton extends VBox {
- public String getContent() {
- return content.get();
- }
- private StringProperty content = new SimpleStringProperty("Hello here");
- public MyButton() throws IOException {
- FXMLLoader loader = new FXMLLoader(getClass().getResource("MyButton.fxml"));
- loader.setController(this);
- loader.setRoot(this);
- loader.load();
- }
- }
Add Comment
Please, Sign In to add comment