/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ShowText1.java |
nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
package lab2_fx2_f22_part1;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class ShowText1 extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Pane pane = new Pane();
pane.setPadding(new Insets(5, 5, 5, 5));
Text text1 = new Text(40, 40, "Java programming is bold and beautiful!");
text1.setFont(Font.font("Impact", FontWeight.BOLD,
FontPosture.ITALIC, 36));
pane.getChildren().add(text1);
Text text2 = new Text(60, 60, "Java Programming is fun\nand Challenging!");
pane.getChildren().add(text2);
Text text3 = new Text(10, 100, "C# Programming is not as beautiful as Java programming!\n Try it!");
text3.setFill(Color.RED);
text3.setUnderline(true);
text3.setStrikethrough(true);
text3.rotateProperty().add(90);
pane.getChildren().add(text3);
Scene scene = new Scene(pane);
primaryStage.setTitle("ShowText");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}