List of usage examples for javax.swing JList getLayoutOrientation
public int getLayoutOrientation()
From source file:Main.java
public static void main(String[] argv) throws Exception { String[] items = { "A", "B", "C", "D" }; JList list = new JList(items); JScrollPane scrollingList = new JScrollPane(list); // The default layout orientation is JList.VERTICAL int orient = list.getLayoutOrientation(); // Change the layout orientation to left-to-right, top-to-bottom list.setLayoutOrientation(JList.HORIZONTAL_WRAP); }