import com.sun.javafx.runtime.VersionInfo;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
stage.setTitle(VersionInfo.getRuntimeVersion());
stage.setScene(createScene());
stage.show();
}
private Scene createScene() {
StackPane root = new StackPane();
final Text text = new Text("Test test test");
String style = "-fx-text-alignment:right;-fx-border-color:red;";
text.setStyle(style);
VBox v = new VBox(5);
v.setFillWidth(true);
v.setMinWidth(200);
v.setStyle("-fx-border-color:green");
v.getChildren().addAll(text, new Label("Text"));
Scene s = new Scene(v);
return s;
}
}
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
stage.setTitle(VersionInfo.getRuntimeVersion());
stage.setScene(createScene());
stage.show();
}
private Scene createScene() {
StackPane root = new StackPane();
final Text text = new Text("Test test test");
String style = "-fx-text-alignment:right;-fx-border-color:red;";
text.setStyle(style);
VBox v = new VBox(5);
v.setFillWidth(true);
v.setMinWidth(200);
v.setStyle("-fx-border-color:green");
v.getChildren().addAll(text, new Label("Text"));
Scene s = new Scene(v);
return s;
}
}