Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fontdemo;
- import javafx.application.Application;
- import javafx.scene.Scene;
- import javafx.scene.layout.*;
- import javafx.scene.paint.Color;
- import javafx.scene.shape.Circle;
- import javafx.scene.text.*;
- import javafx.scene.control.*;
- import javafx.stage.Stage;
- public class FontDemo extends Application {
- @Override
- public void start(Stage primaryStage) {
- Pane pane = new StackPane();
- Circle circle = new Circle();
- circle.setRadius(350);
- circle.setStroke(Color.BLACK);
- circle.setFill(new Color(0.75,1,0.25,0.5));
- pane.getChildren().add(circle); // add circle to the pane
- Label label = new Label("JavaFX");
- label.setFont(Font.font("Impact", FontWeight.BOLD, FontPosture.ITALIC, 200));
- pane.getChildren().add(label); //add circle to the pane
- Scene scene = new Scene(pane);
- primaryStage.setTitle("FontDemo");
- primaryStage.setScene(scene);
- primaryStage.show();
- }
- public static void main(String[] args) {
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment