Skip to content
Advertisement

How to create JOptionPane with multiple list selections and extract all the choices?

I am interested in creating a JOptionPane or any interactable pop-up Pane that contains multiple list selections. I also wish to extract the selections the user made.

The code below shows an MRE where I generate two different JOptionPanes with list selections and extract the choice from each. Essentially, I am trying to combine the two.

JavaScript

What one of them looks like: enter image description here

Advertisement

Answer

JOptionPane is actually very flexible. You could build a container containing any number of components and then use JOptionPane to display it, for example…

enter image description here

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement