Advertisement
Slaurmagan

JavaFX

Oct 18th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. package sample;
  2.  
  3. import javafx.application.Application;
  4. import javafx.fxml.FXMLLoader;
  5. import javafx.scene.Parent;
  6. import javafx.scene.Scene;
  7. import javafx.stage.Stage;
  8.  
  9.  
  10. public class Main extends Application {
  11.  
  12.     @Override
  13.     public void start(Stage primaryStage) throws Exception  {
  14.         FXMLLoader loader = new FXMLLoader(Main.class.getResource("/sample.fxml"));
  15.         Parent content = loader.load();
  16.         primaryStage.setTitle("Hello World");
  17.         primaryStage.setScene(new Scene(content, 700, 500));
  18.         primaryStage.show();
  19.     }
  20.  
  21.  
  22.     public static void main(String[] args) {
  23.         Application.launch(args);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement