
请尝试以下 *** 作:
final DefaultListModel model = new DefaultListModel();final JList list = new JList(model);//another thread to update the modelfinal Thread updater = new Thread() { @Override public void run() { for (int i = 0; i < 10; i++) { model.addElement(i); try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException(e); } } }};updater.start();欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)