Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8124377

TextAilgnment is not applied to the text node

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: javafx
    • Environment:

      jdk1.8.0 b85

      Description

      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;
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              fheidric Felipe Heidrich (Inactive)
              Reporter:
              dzinkevi Dmitry Zinkevich (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:
                Imported: