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

[TitledPane] text alignment property has no effect.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7u6, 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      controls scrum jfx8.0 at august 17, or 2.2.0b21

      Description

      Run code:

          @Override
          public void start(Stage stage) throws Exception {
              final TitledPane pane1 = new TitledPane();
              pane1.setGraphic(new Label("title 1\nLong text long text"));
              pane1.setContent(new Rectangle(100, 40, Color.SKYBLUE));
              Accordion acc = new Accordion();
              acc.getPanes().addAll(pane1);

              final IntegerProperty counter = new SimpleIntegerProperty(0);

              Button button = new Button("Change alignment");
              button.setOnAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent t) {
                      switch (counter.getValue() % 4) {
                          case 0:
                              System.out.println("left");
                              pane1.setTextAlignment(TextAlignment.LEFT);
                              break;
                          case 1:
                              System.out.println("center");
                              pane1.setTextAlignment(TextAlignment.CENTER);
                              break;
                          case 2:
                              System.out.println("right");
                              pane1.setTextAlignment(TextAlignment.RIGHT);
                              break;
                          case 3:
                              System.out.println("justify");
                              pane1.setTextAlignment(TextAlignment.JUSTIFY);
                              break;
                      }

                      counter.setValue(counter.getValue() + 1);
                  }
              });

              VBox pane = new VBox();
              pane.getChildren().addAll(acc, button);
              Scene scene = new Scene(pane, 300, 700);
              stage.setScene(scene);
              stage.show();
          }

      option changing has no effect on visual appearance of control.

        Attachments

          Activity

            People

            Assignee:
            kwwong Kinsley Wong
            Reporter:
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: