Check out example codes for "how to add elements to Jlist". It will help you in understanding the concepts better.

Code Example 1

DefaultListModel<String> model = new DefaultListModel<>();
JList<String> list = new JList<>( model );

for ( int i = 0; i < customers.length; i++ ){
  model.addElement( customers[i].getName() );
}

Learn ReactJs, React Native from akashmittal.com