JList resize pb
I have a JList in a panel and want it to have always half the width of the panel. I use a GridBagLayout. Initially the list is empty and its width is what I expect. But once the list is populated, it resizes to the width of the largest displayed item.
I can avoid this with setPrototypeCellValue() or setFixedCellWidth(), but then the list never resizes when the panel's width changes.
I tried other layout managers, but couldn't find a working one.
What can I do to force my list to always have half the width of the enclosing panel ?