Displaying large amount of data with JList?

前端 未结 3 598
再見小時候
再見小時候 2021-01-24 08:45

I have a JList, wich must display more than 3000 items. I wish to have \"visible\" around 100 items in the list, and when you scroll and getting close to the end (or begining) o

3条回答
  •  悲哀的现实
    2021-01-24 09:36

    I have a JList, wich must display more than 3000 items.

    Huh. You make that sound like a big number. Here is a list holding (and displaying just fine), more than 30 thousand items.

    Big List

    import javax.swing.*;
    
    class BigList {
    
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    int bigNumber = 30001;
                    String[] bigData = new String[bigNumber];
                    for (int ii=0; ii

提交回复
热议问题