Displaying errors, warnings

For displaying error or warning messages to the user, which is the best class to use, JDialog or JOptionPane class?
[122 byte] By [ninjaprogrammera] at [2007-10-3 3:43:43]
# 1
[url http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html]How to Make Dialogs[/url]. What do you think? and why? I would think it would be obvious.
camickra at 2007-7-14 21:39:48 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks. I am sorry. I am new to java.
ninjaprogrammera at 2007-7-14 21:39:48 > top of Java-index,Desktop,Core GUI APIs...
# 3
I have seen this statement JOptionPane.showMessageDialog and JDialog. I was confused.
ninjaprogrammera at 2007-7-14 21:39:48 > top of Java-index,Desktop,Core GUI APIs...