Guest User

Untitled

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <fx:root type="javafx.scene.layout.VBox" xmlns="http://javafx.com/javafx"
  2. xmlns:fx="http://javafx.com/fxml" minWidth="100" minHeight="20">
  3. <Button text="${controller.content}" minWidth="100" minHeight="20"/>
  4. </fx:root>
  5.  
  6.  
  7. public class MyButton extends VBox {
  8.  
  9. public String getContent() {
  10. return content.get();
  11. }
  12.  
  13. private StringProperty content = new SimpleStringProperty("Hello here");
  14.  
  15. public MyButton() throws IOException {
  16. FXMLLoader loader = new FXMLLoader(getClass().getResource("MyButton.fxml"));
  17. loader.setController(this);
  18. loader.setRoot(this);
  19. loader.load();
  20. }
  21.  
  22. }
Add Comment
Please, Sign In to add comment