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

[Text] TextAlignment center ceased to work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      b116

      Description

      TextAlignment.CENTER used to work in b99

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.HBox;
      import javafx.scene.text.TextAlignment;
      import javafx.stage.Stage;

      public class App extends Application {

          private static final String TITLE = "First line first line\nSecond line\nThird line third line";

          public static void main(String[] args) {
              launch(args);
          }
          
          @Override
          public void start(Stage stage) throws Exception {
              
              Button b1 = new Button(TITLE);
              b1.setTextAlignment(TextAlignment.LEFT);

              Button b2 = new Button(TITLE);
              b2.setTextAlignment(TextAlignment.CENTER);

              setSize(b1);
              setSize(b2);

              HBox root = new HBox(4);
              root.getChildren().addAll(b1, b2);

              Scene scene = new Scene(root, 404, 300);
              stage.setScene(scene);
              stage.show();
          }

          private void setSize(Button b) {
              b.setMinWidth(200);
          }
      }

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: