I can't hide or dispose JDialog, If I set JDialog with Boolean Modal = true; otherwise if I set JDialog with Boolean Modal = false I can hide or dispose, but then overriden method paint() doesn't do what I want.
I Tried to SetModal(), but it doesn't succed.
I forgot I had extended JPanel on JDialog.
NewJDialog dialog = new NewJDialog(this, true); // here
in NewJDialog I have private NewJPanel newJPanel1; which has overwritten method paint in NewJPanel