I have an arraylist with objects and a running Gui. I looking for a way to popup a little frame or box or something like that which displays the objects from the arraylist. The user now should be able to choose one or more items which are then returned.
I have already the optionpane but i can just select one object
Object[] possibilities = lr.declarationList.toArray();
String s = (String)JOptionPane.showInputDialog(
gui.getFrame(),
"Choose Target Nodes",
"Customized Dialog",
JOptionPane.PLAIN_MESSAGE,
null,
possibilities,
null);
maybe a popup list would help out.
Try using
JOptionPane.showMessageDialog(...)with a JList component argument whose elements are sourced from your list, for example:Note that if you need more layout items in the message object itself you can pack them all into a JPanel and use that component as the message argument.