Custom dialogs using JOptionPane
When I create a JDialog with a JOptionPane as its content pane, as described here, the JDialog doesn't respect the JOptionPane's message and option type. It always displays as if it were set to WARNING_MESSAGE and OK_OPTION. (There are actually a bunch of things wrong with that example code, including setLabel(String) being undefined, and the fact that optionPane.getValue() does not necessarily return an Integer. In fact, it's initialized as a String.)
It displays correctly if I call JOptionPane.showXXXDialog(...) with my panel as the message, but then I don't know how to validate the input before the dialog closes.
Anyone know of an up-to-date tutorial about this?
Edit: Nevermind. I had my message and option type params reversed.