Originally posted by narayana murthy pedapudi:
I have MDI Application in that i am using JFrames.What i want is when a frame is opened then another instance of the same frame should not open.
is there any method or technique to implement this. when that frame is closed then u can open that frame.
Use a static variable in the frame class to maintain number of active instances of the frame. If it is zero then only instantiate a new instance.
Whenever you close a frame subtract 1 from the static variable ( in the windowClosing() method of WindowListener).
This will solve your problem