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

TitledPane inside VBox ignores maxWidth of parent when layouting content

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 8u5
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Labels:
    • Environment:

      Win 7 x64 jdk 8_u5

      Description

      Hey,

      when I put a long label with text wrap enabled inside a TitledPane and then wrap the TitledPane inside a VBox, the TitledPane does not wrap the label text at all.

      Some example code:

      public class TitledPaneBug extends Application
      {
        @Override
        public void start(final Stage primaryStage) throws Exception
        {
          final Label label = new Label("a label with some long text that should make sure that the text is really wrapped");
          label.setWrapText(true);

          final TitledPane pane = new TitledPane();
          pane.setContent(label);

          final VBox box = new VBox(pane);
          box.setMaxWidth(200);
          primaryStage.setScene(new Scene(box));

          // uncomment this line and comment out the three lines above for the
          // expected behaviour
      // primaryStage.setScene(new Scene(pane));

          primaryStage.setWidth(200);
          primaryStage.setHeight(100);
          primaryStage.show();
        }

        public static void main(final String... args)
        {
          launch(args);
        }
      }

        Attachments

          Activity

            People

            Assignee:
            msladecek Martin Sládeček
            Reporter:
            cmuthingjfx Clemens Muthing (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: