Rob Camick wrote:You can add any component to a JOptionPane.
So yes you can add a JPanel containing those two components.
JOptionPane's
message parameter is declared to be of type Object. So, yes, you can pass a JPanel and it will work, but you don't actually need to use a JPanel.
You can pass a simple array for the
message (for example, an array of length 5 that contains a String, a JTextField, another String, a JComboBox, and one more String). This is described in the JavaDocs for JOptionPane, not in the method descriptions but in the text at the top of the javadoc page.