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

ListCell ignores setMaxWidth value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • fx2.1
    • javafx
    • 2.1-b14

      I want to limit list cells in width. How can I do that?

      Direct approach doesn't work:

              Callback<ListView<Object>, ListCell<Object>> cellFactory
                      = new Callback<ListView<Object>, ListCell<Object>>() {

                  @Override
                  public ListCell<Object> call(ListView<Object> p) {
                      return new ListCell() {
                          
                          {
                              setText("abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz ");
                              setMinWidth(100);
                              setMaxWidth(100);
                          }
                      };
                  }

              };

            Unassigned Unassigned
            mrkam Alexander Kuznetcov (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported: