[ListView, TreeView] does not honor min height of cells

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 7u21
    • Component/s: javafx
    • None
    • Environment:

      FX 2.2.21-b11

      If you try running the code below and move the "//" from minSize to prefSize, you will see that the listView does not honor minSize – only prefSize of list cells.

      public class PersonListCellFactory implements Callback<ListView<Person>, ListCell<Person>> {
      private boolean showFullNames;

      public PersonListCellFactory() {
      this(true);
      }

      public PersonListCellFactory(boolean showFullNames) {
      this.showFullNames = showFullNames;
      }

      @Override
      public ListCell call(ListView<Person> list) {
      ListCell<Person> cell = new ListCell<Person>() {
      @Override
      protected void updateItem(Person person, boolean empty) {
      super.updateItem(person, empty);
      double size = 72;
      // setMinSize(size, size);
      setPrefSize(size, size);
      if(!empty) {
        setText("not empty);
      }
      else {
        setText("empty");
      };
      return cell;
      }
      }

            Assignee:
            Jonathan Giles
            Reporter:
            Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: