Could need some help with Swing
Hi all.
Have some issues with Swing, or more specifically, how to control the layout. I want to have a window where one part, at the bottom, has a rather constant size and the rest is taken by list. Only thing is that when I add things to the list it starts pushing down everything bellow it and resizing the window. I want to make so I instead get a scroll bar, or something like that. Not that good with layout managers, to be honest, so it is a real challenge. My code at the moment looks like this:
The method will create a frame and return it. mLstModel is the model for the list and mClose is the action listener for the close button (I made it a variable because I figured it would mean less objects will be created, which may make things easier for the gc... or something, lol, I may be thinking completely wrong). Not asking for you to code for me, but any pointers and help with how to make it work the way I want it to, i.e. making so adding stuff to the list won´t push down the components bellow it and won´t start to resize the window, would be deeply appreciated.
Tell me if you want more code, this method is the only one that actually creates the window and its components. The rest just deals with what is created, so to speak.
Take care,
Kerr.
Re: Could need some help with Swing
Re: Could need some help with Swing
Ok, thanks, will test that :).
EDIT:
Worked perfectly, thanks.