package test.scenegraph.app; import javafx.application.Application; import javafx.application.Platform; import javafx.builders.DisplacementMapBuilder; import javafx.builders.RectangleBuilder; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.effect.DisplacementMap; import javafx.scene.effect.DropShadow; import javafx.scene.effect.FloatMap; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage; import javafx.scene.effect.InnerShadow; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.shape.Rectangle; import javafx.scene.shape.StrokeType; import javafx.scene.text.Font; import javafx.scene.text.FontPosture; import javafx.scene.text.FontWeight; import javafx.scene.text.Text; import javafx.scene.text.TextAlignment; public class ShortAppWithoutDependencies5111 extends Application { GridPane pane; GridPane paneText; @Override public void start(Stage stage) { Pane p = new VBox(); p.setMaxWidth(200); p.setStyle("-fx-border-color: blue"); p.setTranslateX(50); p.setTranslateY(50); HBox h = new HBox(); Pane p2 = new VBox(); h.getChildren().addAll(p,p2); Scene scene = new Scene(h); stage.setScene(scene); stage.setWidth(500); stage.setHeight(500); final String strTxt = "The quick brown fog jumps over the lazy fog"; final String strTxt2 = "The quick brown fog jumps over the lazy dog"; final String strTxt3 = "The quick brown dog jumps over the lazy dog"; /* Text t2 = new Text(); t2.setFont(new Font(20)); t2.setWrappingWidth(200); t2.setText(strTxt); t2.setTextAlignment(TextAlignment.JUSTIFY); p.getChildren().add(t2); Text t2a = new Text(); t2a.setFont(new Font(20)); t2a.setWrappingWidth(200); t2a.setText(strTxt2); t2a.setTextAlignment(TextAlignment.JUSTIFY); p.getChildren().add(t2a); */ Text t2b = new Text(); t2b.setFont(new Font(20)); t2b.setWrappingWidth(200); t2b.setText(strTxt3); t2b.setTextAlignment(TextAlignment.JUSTIFY); p.getChildren().add(t2b); /* Group g = new Group(); Rectangle rect = new Rectangle(); rect.setWidth(200); rect.setHeight(40); rect.setFill(Color.TRANSPARENT); rect.setStrokeType(StrokeType.CENTERED); rect.setStroke(Color.RED); rect.setStrokeWidth(0); */ Text t5 = new Text(); t5.setFont(new Font(20)); t5.setWrappingWidth(200); t5.setText(strTxt); t5.setTextAlignment(TextAlignment.CENTER); //g.getChildren().addAll(rect,t5); p.getChildren().add(t5); Text t5a = new Text(); t5a.setFill(Color.BLUE); t5a.setFont(new Font(20)); t5a.setWrappingWidth(100); t5a.setText(strTxt2); t5a.setTextAlignment(TextAlignment.RIGHT); p.getChildren().add(t5a); Text t5b = new Text(); t5b.setFill(Color.BLUE); t5b.setFont(new Font(20)); t5b.setWrappingWidth(200); t5b.setText(strTxt3); t5b.setTextAlignment(TextAlignment.RIGHT); p.getChildren().add(t5b); stage.setVisible(true); } public static void main(String args[]) { Application.launch(ShortAppWithoutDependencies5111.class, args); } }