Make a JList expand to fill control?

Use a LayoutManager which fits your needs :-).

Use a LayoutManager which fits your needs :-) To elaborate a slight bit (so nobody is missing the sermon :) whenever there are problems (expected vs. actual behaviour) in sizing/positioning components, the answer is LayoutManager All core implementations behave differently, out-in-the-wild they are often lacking - too simple, not powerful enough, not flexible enough ... At the end of the day, it's worth to give any of the big-three (Form-, Mig- or DesignGridLayout) a thorough look (the learning curve is not exactly flat) and then stick to it. My current personal favourite is Mig, followed by Form and Design.

Up vote 2 down vote favorite share g+ share fb share tw.

Is there anyway a JLIst can be set to expand to fit the size of the container/panel. Even if it adds empty white space its better than having odd sizes every time the amount of data changes. Thanks java swing gui jlist link|improve this question asked Nov 8 '11 at 10:58SkyR28017 75% accept rate.

Use a decent LayoutManager ;-) – kleopatra Nov 8 '11 at 11:38 Thanks :) used BorderLayout and added to the center. If you answer I will mark yours correct – SkyR Nov 8 '11 at 11:50 I suspect that @kleopatra regards BorderLayout as 'indecent'. ;) – Andrew Thompson Nov 8 '11 at 12:01 @Andrew not if the requirement is simple enough :-) – kleopatra Nov 8 '11 at 12:39.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions