I have some code that I thought would work to make an horizontal JList, but it doesn't.
listModel = new DefaultListModel();
someButton.addActionListener( new ActionListener(){
public void actionPerformed( ActionEvent ae ){
listModel.addElement( //i got some
string in here );}});
list = new JList( listModel );
list.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
list.setLayoutOrientation( JList.HORIZONTAL_WRAP );
JScrollPane scroll = new JScrollPane( list );
panel.add( scroll );
So with this code, I get a little dot of a list and it never adds the items that are to be added in the list. When I remove the scroll, then it works fine, but still not horizontal. Anyone knows how to make this
thing go horizontal?!
Thx!!!