📅  最后修改于: 2022-03-11 14:48:22.556000             🧑  作者: Mango
DefaultListModel model = new DefaultListModel<>();
JList list = new JList<>( model );
for ( int i = 0; i < customers.length; i++ ){
model.addElement( customers[i].getName() );
}