At the moment in my program I have a menu bar and a variety of toolbars which all work perfectly fine. The program already has one panel which holds all the toolbars in but I now need to include another panel. This new panel will hold components in it and the background colour will be white.
However I just can't seem to find a way to make this new panel work with the program. The panel will either completely hide the toolbar panel and the window will be all white (except for the menu) or the new panel won't show at all and only the toolbar panel will be visible. I have managed to get the panel showing by using width and height however I need the panel to stretch across the whole window.
Basically I need to find a way to make the new panel start underneath the previous panel and stretch the entire window. Any help would be much appreciated and I am willing to post code if you need it
Which LayoutManager are you using? The default LM probably won't do what you want. If your white panel should occupy all the frame that isn't taken by the toolbar panel, the easiest LM is probably BorderLayout. The white panel can be centre and the toolbar panel can PageStart/North or PageEnd/South.
Programming is like sex: one mistake and you’re providing support for a lifetime...
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Yep BorderLayout is what I'm trying to use for the white panel but when I set it to centre it disappears completely. The toolbar panel is actually set to FlowLayout as I can position the different toolbars horizontally across the frame. The toolbar panel is set to FlowLayout.LEFT
After a while of trying to get this to work I have managed to do it. Thankyou for your post as ultimately that helped fix the problem. I had assigned a BorderLayou position for the new panel but forgot to do that for the other one.