Ian Taylor wrote:Should I be using JOptionPane or Dialog instead? Every tutorial I can find on using these seems to involve using them to display simple messages or a simple user input (such as Yes/No). I haven't found a tutorial on how to inbed other jComponents inside, or even to what extent it is possible.
Something missed by most beginners, as it's not really clear from any of the popular tutorials, is that the
message argument to
JOptionPane's
show...Dialog(...) methods is declared as
Object.
JOptionPane is one of the smartest classes in the JDK: it can deal with a
Component or an array as a
message, not just with simple
Strings.
I suggest you write a small class just with a
main(...) method that creates a message, and displays it in a
JOptionPane's dialog. Its capabilities may impress you. If you're not sufficiently impressed, try an array (
Component[] or
JComponent[]) filled with different subclasses.