Trying to get an editable JComboBox to work on a JOptionPane
I am trying to avoid all of the work necessary to get a JDialog to look nice like a JOptionPane, but of course, JOptionPane doesn't explicitly offer an editable JComboBox.
As you know, you can get a JOptionPane to display a field that looks like a non-editable JComboBox with a call like the following (taken from "How to make Dialogs" (http://java.sun.com/j2se/1.5.0/docs/api/)):
Object[] possibilities ={"ham","spam","yam"};
String s = (String)JOptionPane.showInputDialog(
frame,
"Complete the sentence:\n"
+"\"Green eggs and...\"",
"Customized Dialog",
JOptionPane.PLAIN_MESSAGE,
icon,
possibilities,
"ham");
All I want to do is make the apparent JComboBox editable, which, of course, means that in addition to choosing one of the available options, you can enter your own.
Is there a reasonably straightforward way of doing this? I am willing to extend JOptionPane and JDialog to achieve this, but obviously, I don't want to have to duplicate most of the routines with new versions for an editable JComboBox.
An alternative is for me to break the input up into three dialogs where the first dialog asks something like "Do you want to enter a new value or choose from previously used valid values?" and then go to one of the other two dialogs based on the answer. Obviously, I would be sacrificing ease-of-use for ease of programming if I did this...
Thanks in advance for your advice.

