import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.layout.HBox; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.input.KeyEvent; import javafx.scene.paint.Color; import javafx.stage.Stage; public class HelloButton extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { stage.setTitle("Hello Button"); //Group root = new Group(); // this still works HBox root = new HBox(); // this fails Scene scene = new Scene(root, 600, 450); scene.setFill(Color.PALEGREEN); Button button = new Button(); button.setText("Button"); root.getChildren().add(button); stage.setScene(scene); stage.show(); } }