hipal
asked on
Random components on resizing frame
When I resize my frame (using button between minimize and close) I get few random components added to my frame (like JFileChooser) and JComponents which I added disappear.
Can some one please say something about such a behavior :(
Can some one please say something about such a behavior :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i mean adding or removing components
ASKER
The problem is not when I am moving/adding but when I am resizing frame
i realise that. resizing will trigger a relayout of the frame
and if you resize the frame by increasing onli width or height, do they dissapear in the same way?
ASKER
when I say resize I actually mean resizing by clicking the by default 'restore' button between minimize and close tab ..even if I just increase height or width of frame using mouse .. the effect is same ..
Shall i try to resize frame in program on pressing a button ?? I mean is this what you want me to try when you asked "if you resize the frame by increasing onli width or height, do they dissapear in the same way?"
Shall i try to resize frame in program on pressing a button ?? I mean is this what you want me to try when you asked "if you resize the frame by increasing onli width or height, do they dissapear in the same way?"
definitely sounds like your not adding/removing components correctly (causing the panel to be not laid out as directed). When you resize the frame the frame gets laid out so that why you see the problem then.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
how the components that disappear are added to your container? by add and setBounds() or not?
ASKER
sry fr late reply .. they are added using add()
ASKER
@CEHJ .. thanks a lot for responding.. but CEHJ .. I have been doing so in so many other small programs .. nothing wents wrong ..seems like I am doing something wrong here which I am not able to notice..
will go through code once again .. else will post it
thank you all of you experts !!
will go through code once again .. else will post it
thank you all of you experts !!
you'll get the same problem regardless of whether you use a layout manager or not (in fact it gets more complicated using a layout manager because adding a component can cause other to move)
see my earlier comments for likely cause of the problem.
see my earlier comments for likely cause of the problem.
ASKER
thanks for response..
can you please elaborate on your previous comment which is
:definitely sounds like your not adding/removing components correctly (causing the panel to be not laid out as directed). When you resize the frame the frame gets laid out so that why you see the problem then.:
can you please elaborate on your previous comment which is
:definitely sounds like your not adding/removing components correctly (causing the panel to be not laid out as directed). When you resize the frame the frame gets laid out so that why you see the problem then.:
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am using null layout ..