Preventing disappearance of the drawings?

Well i am working on a paint program, i created the main frame gui, for entering parameters i created another jframe, since java does not have a close method, i just change the visiblity of the second frame to false and make it invisible.. the problem is that whenever i enter parameters to the second frame for drawing a line, it draws the line, but whenever i call the frame back, the line disappears.. same thing also happens when i resize the main frame. How can i prevent that?

[489 byte] By [oforcea] at [2007-11-27 4:53:07]
# 1
I think the problem is that when you go back to the first frame, it repaints the frame, and thus writes over the drawing.What you need to do make the changes to an image, then have the image "drawn" on the JFrame in the repaint() method.
BobCa at 2007-7-12 10:07:22 > top of Java-index,Security,Cryptography...