Monty374

JFX 6.2

Dec 6th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. package fontdemo;
  2.  
  3. import javafx.application.Application;
  4. import javafx.scene.Scene;
  5. import javafx.scene.layout.*;
  6. import javafx.scene.paint.Color;
  7. import javafx.scene.shape.Circle;
  8. import javafx.scene.text.*;
  9. import javafx.scene.control.*;
  10. import javafx.stage.Stage;
  11.  
  12. public class FontDemo extends Application {
  13. @Override
  14. public void start(Stage primaryStage) {
  15. Pane pane = new StackPane();
  16. Circle circle = new Circle();
  17. circle.setRadius(350);
  18. circle.setStroke(Color.BLACK);
  19. circle.setFill(new Color(0.75,1,0.25,0.5));
  20. pane.getChildren().add(circle); // add circle to the pane
  21. Label label = new Label("JavaFX");
  22. label.setFont(Font.font("Impact", FontWeight.BOLD, FontPosture.ITALIC, 200));
  23. pane.getChildren().add(label); //add circle to the pane
  24. Scene scene = new Scene(pane);
  25. primaryStage.setTitle("FontDemo");
  26. primaryStage.setScene(scene);
  27. primaryStage.show();
  28. }
  29.  
  30. public static void main(String[] args) {
  31. launch(args);
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment