import java.awt.*; import javax.swing.*; public class List extends JFrame { public static void main(String[] args) { List t = new List(); ListModel bigData = new AbstractListModel() { public int getSize() { return Short.MAX_VALUE; } public Object getElementAt(int index) { return "Index " + index; } }; JList bigDataList = new JList(bigData); //use the following method for performance reasons bigDataList.setPrototypeCellValue("Index 1234567890"); JScrollPane js = new JScrollPane(bigDataList); t.getContentPane().add(js); t.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); t.setVisible(true); } }