How can I get a JList to show in a JPenel. For example I'd like to have the following groups of items displayed in a JPanel, with each group showing on it's own column, with a new group being dropped into a new line, like how Google lists search results.
For example:
import java.util.ArrayList;
import java.util.List;
import javax.swing.JPanel;
public class ReaderImpl {
JPanel paneTo = new JPanel();
List<String> text() {
List<String> lovely = new ArrayList<String>(4);
lovely.add("Tall, Short, Average"); // line 1
lovely.add("mangoes, apples, Bananas"); // line 2
lovely.add("12, 33");
return lovely;
}
// How do I add the lovely ArrayList to paneTo
}