I have Class which extends JDialog
.
Have an another JDialog declared inside the class as
private JDialog Dialog = new JDialo开发者_如何学编程g(this);
I want to display a error dialog in the declared dialog of the class.
How can i Achieve this.
I needed it for display purpose...now that they JTextfield
s in the declared dialog, need to put a error dialog... at the center of the declared dialog... this is the requirement
But error dialog are visible, but behind the declared dialog, i.e on the derived JDialog
of the class...
Thank you in advance....
I do not know exactly what you mean. However, if you want an error message dialog, why don't you just use a JOptionPane? It works very easy, e.g. like this:
JOptionPane.showMessageDialog(null, "message", "title", JOptionPane.ERROR_MESSAGE);
For layout, you can even use html in the message. Like for example:
<html>This went <b>wrong!</b><br>Next line</html>
Hope this is what you need :)
You must show the error dialog withing the child dialog. BTW, use a JOptionPane to show error dialogs.
精彩评论