-
Bug
-
Resolution: Not an Issue
-
P3
-
8
The problem is in the javax.swing.JList#getPreferredScrollableViewportSize method:
...
Rectangle r = getCellBounds(0, 0);
if (r != null) {
height = (visibleRowCount * r.height) + dy;
}
...
return new Dimension(width, height);
Note that the size is calculated from the height of the first list item, which is incorrect. This causes items in popups with lists, having no fixed size, to have extra/unwanted space.
...
Rectangle r = getCellBounds(0, 0);
if (r != null) {
height = (visibleRowCount * r.height) + dy;
}
...
return new Dimension(width, height);
Note that the size is calculated from the height of the first list item, which is incorrect. This causes items in popups with lists, having no fixed size, to have extra/unwanted space.
- relates to
-
JDK-8198777 JList.getPreferredScrollableViewportSize(): fix mistake in doc for height calc
- Resolved