/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/FontDemo2.java |
package lab2_fx2_f22_part1;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.text.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
public class FontDemo2 extends Application {
@Override
public void start(Stage primaryStage) {
Pane pane = new StackPane();
Scene scene = new Scene(pane);
primaryStage.setScene(scene);
primaryStage.setTitle("FontDemo2");
Circle circle = new Circle();
circle.setRadius(300);
circle.setStroke(Color.BLACK);
circle.setFill(Color.GRAY);
pane.getChildren().add(circle);
Label label = new Label("JavaFX");
label.setRotate(90.0);
label.setFont(Font.font("Comic Sans MS",
FontWeight.NORMAL, FontPosture.ITALIC, 96));
label.setTextFill(Color.YELLOW);
pane.getChildren().add(label);
primaryStage.show();
}
public static void main(String[] args)
{
launch(args);
}
}