I have a JList with very long element names that make the horizontal scrollbar appear in the scroll pane.
Is there anyway that I can wrap words so that the entire whole name of the element is displayed in 2 lines, but can be selected with one click? IE, it should still behave as a separate element, but display in two lines.
Here is what I did after watching the example below
I added a new class to my MyCellRenderer project, and then added the code MyList.setCellRenderer(new MyCellRenderer(80)); into the post creation code on my list. Anything else I need to do?
java swing jlist jscrollpane
koool
source share