Skip to content

Instantly share code, notes, and snippets.

@naokirin
Created January 18, 2012 19:28
Show Gist options
  • Save naokirin/1635048 to your computer and use it in GitHub Desktop.
Save naokirin/1635048 to your computer and use it in GitHub Desktop.
JavaFX Hello,World
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.scene.control.Label;
public class JavaFXHelloWorld extends Application{
public static void main(String[] args){
Application.launch(JavaFXHelloWorld.class, args);
}
@Override
public void start(Stage stage) {
HBox hbox = new HBox();
Scene scene = new Scene(hbox);
hbox.getChildren().add(new Label("Hello, World"));
stage.setScene(scene);
stage.setTitle("Hello");
stage.show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment