multiple selection list

JList Multiple Selection Example Java Swing

In the previous program, you have seen JList with single selection. Now let us go for JList Multiple Selection. In the following JList Multiple Selection example, user’s multiple selected items are displayed in JOptionPane using showMessageDialog() method.

places.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); The above statement allows the list for multiple selections. By clicking…

Java AWT List Multiple Single Selection

List permits the selection of multiple items (Choice allows single selection). Programmer prefers List when checkboxes are many to display (in case of Choice, when radio buttons are many to display). List adds a scrollbar with which items can be scrolled and seen. List can be designed for single selection…