Results 1 to 1 of 1
Thread: Custom dialogs using JOptionPane
- 10-21-2013, 12:01 AM #1
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.
Last edited by kjkrum; 10-21-2013 at 12:04 AM.Get in the habit of using standard Java naming conventions!
- By Return 0 in forum New To JavaReplies: 12Last Post: 01-27-2012, 02:44 PM
- By trader5050 in forum New To JavaReplies: 1Last Post: 11-24-2010, 08:29 AM
- By frejon26 in forum Threads and SynchronizationReplies: 1Last Post: 05-23-2010, 05:49 AM
- By zenteo in forum AWT / SwingReplies: 6Last Post: 03-08-2010, 11:01 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 12-17-2007, 10:46 AM