Advertisement
Guest User

JavaFX source code

a guest
May 17th, 2024
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import javafx.application.Application;
  2. import javafx.geometry.Pos;
  3. import javafx.scene.Scene;
  4. import javafx.scene.control.Button;
  5. import javafx.scene.control.Label;
  6. import javafx.scene.layout.GridPane;
  7. import javafx.scene.layout.StackPane;
  8. import javafx.scene.text.Font;
  9. import javafx.scene.text.Text;
  10. import javafx.stage.Stage;
  11. public class sample extends Application {
  12. public static void main(String[] args) {
  13. launch();
  14. }
  15.  
  16. public void start(Stage stage) throws Exception {
  17. GridPane gridPane = new GridPane();
  18. Text heading = new Text("Sample");
  19. heading.setFont(new Font(56));
  20. gridPane.add(heading, 0, 0);
  21. Scene scene = new Scene(gridPane);
  22. stage.setMaximized(true);
  23. stage.setScene(scene);
  24. stage.show();
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement