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

Text is rendered ouside of control in vbox

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Duplicate
    • 8
    • 8
    • javafx
    • b97

    Description

      When several controls are put in the vbox the text is not clipped

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.Labeled;
      import javafx.scene.control.ToggleButton;
      import javafx.scene.control.ToggleButtonBuilder;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class Bug extends Application {

          public static final String WRAPPED =
                  "wrapped wrapped wrapped wrapped wrapped wrapped\n" +
                  "wrapped wrapped wrapped wrapped wrapped wrapped\n" +
                  "wrapped wrapped wrapped wrapped wrapped wrapped\n" +
                  "wrapped wrapped wrapped wrapped wrapped wrapped\n";
          public Labeled createControl() {
              ToggleButton button = ToggleButtonBuilder.create().selected(false).text(WRAPPED)
                      .focusTraversable(false).build();

              return button;
          }

          public static void main(String[] args) {
              launch(Bug.class, args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              VBox root = new VBox();
              for (int i = 0; i < 6; i++) {
                  Labeled contr = createControl();
                  root.getChildren().add(new Label("Label " + i));
                  root.getChildren().add(contr);
              }

              Scene scene = new Scene(root, 200, 400);
              stage.setScene(scene);
              stage.show();
          }
      }

      Attachments

        Issue Links

          Activity

            People

              miflemi Mick Fleming
              dzinkevi Dmitry Zinkevich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: