Java Reference
In-Depth Information
JOptionPane.showInternalInputDialog(desktop, "Pick a printer", "Input",
JOptionPane.QUESTION_MESSAGE, null, smallList, "Triton");
// Twenty of the moons of Saturn
String bigList[] = {"Pan", "Atlas", "Prometheus", "Pandora", "Epimetheus",
"Janus", "Mimas", "Enceladus", "Telesto", "Tethys", "Calypso", "Dione",
"Helene", "Rhea", "Titan", "Hyperion", "Iapetus", "Phoebe", "Skadi",
"Mundilfari"};
JOptionPane.showInputDialog(parent, "Pick a printer", "Input",
JOptionPane.QUESTION_MESSAGE, null, bigList, "Titan");
Figure 9-5. Sample JOptionPane input pop-ups
Note It is the responsibility of the look and feel to determine the type of input component. A look and feel
can use something other than a JTextField , JComboBox , or JList . It's just that all the system-provided
look and feel types (from Sun) use these three components.
 
Search WWH ::




Custom Search