java - Which Swing layout manager should I use? -
i creating swing dialog window below:
the header
, footer
areas have fixed size. area 1 , 2
's size not fixed. can have several lines of content , line number can increase at runtime
.
and in future, may need add area 3
.
how should use swing layout managers achieve ui?
add 1
the area 1 , 2 independent of each other.
in each of them, want place several panels vertically. each panel hold line of string. panel number can vary @ runtime.
use borderlayout
main layout.
- add "header"
north
. - add "footer"
south
. - create panel , add
center
. set layout manager of panel appropriate layout manager. can't advise layout manager use panel since don't know how 2 components area related. add "area1" , "area2" panel.
the key answer don't need use single layout manager, can nest panels different layout managers.
Comments
Post a Comment