My borderlayout setup is messing up! please help!
I have the following setup:
MainPanel.add(toolbar, BorderLayout.NORTH);
MainPanel.add(toolbar2,BorderLayout.SOUTH);
ScrollPane.add(new JPanel.add(viewPanel));
MainPanel.add(ScrollPane,BorderLayout.WEST);
MainPanel.add(EastPanel,Borderlayout.East);
MainFrame.add(MainPanel);
Above is roughly my layout. I basically have 2 tool bars and 2 panels in a borderlayout and it displays as if my ScrollPane(west side) is taking over the space of the WEST and CENTER and my EastPanel is taking over the East side - just what I want.
The problem is sometimes my ScrollPane takes over the entire middle section of the MainFrame, taking out the EastPanel. Also, sometimes my scrollPane gets shifted all the way to the West and there is a gap in the Center. I basically just want a layout with two tool bars - one on top, one on bottom, and two panels in between - one is the main display panel and another panel on the side. The Frame is adjustable as well.
Can someone help me out with my problem? Is it the Scrollpane or BorderLayout tries to force the components back to a 5 region layout? The error doesn't come that often but it does happen. enough to be a concern.
Thank you!

