How to create a JList component?
JList is a component that displays a list of objects and allow user to select one or more items. To create an instance of
JList we can pass a vector, an array of objects or a
ListModel. In this example we'll passing an array of objects that contains a date, string and numbers as the parameters.
By default the list does not display a scrollbar. To give our
JList component a scrollbar we must wrap it with a