Code is shown below;
var pp = new Panel(new BorderLayout());
            var p = new Panel(new FlowLayout(CENTER, CENTER, VERTICAL, 2));

            for (var k = 0; k < 1000; k++) {
                var e = new TextField(k.toLocaleString());

                e.setPreferredSize(100, 30);
                e.setBackground(“white”);
                e.id = k.toLocaleString();
                p.add(e);
           
            }
            var scrollpan = new ScrollPan(p);
            scrollpan.id = “scrollpan”;
            pp.add(CENTER, scrollpan);

Please login or Register to Submit Answer