I have a Jlist like the one below. I am using the JList.HorizontalWrap to achieve this, but for some reason, after the 4th item in the list, it starts a new row.
Here is the configurations I used to get the list looking this.
sList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
sList.setVisibleRowCount(-1);
sList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
Is there any way I can set the List row count to be the width of the Jlist so that all items in the list will be set across before starting a new row?
As I noted in my comment, your problem lends itself well to solving through creation of an SSCCE. In fact, I did one myself using your code snippet and some of my code:
Since I cannot reproduce your problem with my code, I must conclude that your problem lies elsewhere in code that you’ve not shown us. Again, if you can create and post your SSCCE, we will likely be able to help answer your question, but until then, I’m not sure if we can even guess what the problem is.