import
javafx.application.Application;
import
javafx.scene.Scene;
import
javafx.scene.control.*;
import
javafx.scene.layout.*;
import
javafx.stage.Stage;
import
javafx.scene.layout.*;
import
javafx.scene.paint.*;
import
javafx.scene.text.*;
import
javafx.geometry.*;
import
javafx.scene.layout.*;
import
javafx.scene.shape.*;
public
class
FontPosture_1
extends
Application {
public
void
start(Stage stage)
{
try
{
stage.setTitle(
"FontPosture"
);
TextFlow text_flow =
new
TextFlow();
Text text_1 =
new
Text(
"GeeksforGeeks\n"
);
text_1.setFill(Color.GREEN);
Font font = Font.font(
"Verdana"
, FontWeight.EXTRA_BOLD,
FontPosture.REGULAR,
25
);
text_1.setFont(font);
Text text_2 =
new
Text(
"A Computer Science portal for geeks\n"
);
text_2.setFill(Color.GREEN);
Font font1 = Font.font(
"Verdana"
, FontWeight.EXTRA_BOLD,
FontPosture.ITALIC,
12
);
text_2.setFont(font1);
text_flow.getChildren().add(text_1);
text_flow.getChildren().add(text_2);
text_flow.setLineSpacing(
20
.0f);
text_flow.setTextAlignment(TextAlignment.CENTER);
VBox vbox =
new
VBox(text_flow);
vbox.setAlignment(Pos.CENTER);
Scene scene =
new
Scene(vbox,
400
,
300
);
stage.setScene(scene);
stage.show();
}
catch
(Exception e) {
System.out.println(e.getMessage());
}
}
public
static
void
main(String args[])
{
launch(args);
}
}