Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;

public class Main {
    public static void main(String[] args) {
        int bigNumber = 30001;
        String[] bigData = new String[bigNumber];
        for (int ii = 0; ii < bigNumber; ii++) {
            bigData[ii] = "String " + (ii + 1);
        }
        JList list = new JList(bigData);
        list.setVisibleRowCount(5);

        JOptionPane.showMessageDialog(null, new JScrollPane(list));
    }
}