I'm trying to keep this fairly clean and on a single reference to a JFrame
, a cut and skinned version of the application is as follows:
public class Client extends SuperclassNotJFrame
private JFrame frame;
method a()
frame = new Frame("first frame").setSize(400,400).setVisible(true)
endmethod
method b()
frame = new Frame("second frame").setSize(800, 600).setVisible(true)
endmethod
endclass
If I call method a()
and then later call method b()
, the frame created during method a()
will stay, even though I've completely removed the reference the frame created there by over-writing it with the new frame.
I've even tried doing frame = null
in b()
, with the same result.