Reputation: 7
I have a JList that gets filled up with values with a DefaultListModel.
By entering a name and pressing on a button it gets listed in the JLlist (vertical wrap).
But the odd thing is they get placed underneath each other properly (8 items). But starting from 8 items suddenly al the items get listed right of it again (like shown below).
The JList itself is more then big enough, so what could be causing this most odd behaviour? All the items below get stored in a list and are being added to the default list model.
1 9
2 10
3
4
5
6
7
8
But the proper output should be everything listed underneath each other.
Upvotes: 0
Views: 100
Reputation: 324128
Read the JList API and follow the link to the Swing tutorial on "How to Use Lists". There it will explain about the "setLayoutOrientation" method which supports 3 values:
You must have set this property somewhere in your code.
Upvotes: 4