> i read the JDialog API and i see that u cant create a
> JDialog with a JPanel as its owner. howcome? is there
> a way i could change this without messing a whole lot
> of things up?
I'm learning swing, so sorry if this is a stupid question, but what do you mean by the JDialog's "owner"?
My reading of the API suggests that the JDialog contains a rootPane as its content pane, and that you can add things to the rootpane through the jdialog's getcontentpane method, but I couldn't find anything about another swing component owning the jdialog.
Thanks in advance.
> I'm learning swing, so sorry if this is a stupid
> question, but what do you mean by the JDialog's
> "owner"?
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
"Every dialog is dependent on a frame. When that frame is destroyed, so are its dependent dialogs. When the frame is iconified, its dependent dialogs disappear from the screen. When the frame is deiconified, its dependent dialogs return to the screen. The AWT automatically provides this behavior."
It doesn't really make sense to have a JPanel as the owner.
i found out how to get the JFrame parent of my JDialog (it was in another class): editDialog = new JDialog((JFrame)getParent().getParent().getParent().getParent().getParent().getParent().getParent().getParent(), "Edit Contact", true);
is there a better way of doing this (less getParent() methods)?