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

[TitledPane] text alignment property has no effect.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 8
    • 7u6, 8
    • javafx
    • controls scrum jfx8.0 at august 17, or 2.2.0b21

      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.

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

              Created:
              Updated:
              Resolved:
              Imported: