java - Update (and grow) dialog when new components are added -


i've got jdialog window user can add components manually "+" knob.

i window resized automatically after each addition.

pack() works before dialog set visible. visible, doesn't change de windows dimension.

is there alternate/complementary way pack() ?

kind regards,

is there alternate/complementary way pack() ?

no, use pack() call not re-lay out components resize containing top-level window (here jdialog).

but visible, doesn't change de windows dimension.

it doesn't matter if window visible. if pack() called on visualized top-level window ( big if), will change window's dimensions, if gui using layout managers properly. if yours not being changed, perhaps you're not calling method on correct reference or not using layouts in way, , in situation, want show pertinent code.

your question begs question -- why not use pack()? if it's because changes being done jpanel held jdialog, can dialog or whatever top-level window holds jpanel (or component) using swingutilities.getwindowancestor(component c).


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -