JScrollPane width won't reduce with window
I am using NetBeans 7.0.1 to create a GUI application. Within the main frame I have a JPanel which contains a JScrollPane which contains a JTree. The issue is that when I resize the running application window, the tree will get bigger with the window and I can see the scroll bars. Whn I reduce the window size, the horizontal scrolbar will move up all the to the top of the scrollpane and can be seen but the vertical scrollbar moves in only so far and then disappears to the side. Plus the horizontal scrollbar never hows a slider. It acts as if the scrollpane will only reduce so far and then the right side of it is not visible because it is outside of the visible window. I have tried all sorts of things with maximumsize, minimumsize, preferredsize, etc. Nothing has worked. Any help?
Re: JScrollPane width won't reduce with window
I figured it out.
A couple things I failed to mention in the first place.
I created a Java Desktop Application in netBeans. This creates a JDesktop Application that starts with a main FrameView that has a MenuBar (JMneuBar), a mainPanel (JPanel), and a statusBar (JPanel). Inside the mainPanel, I added a JPanel with a couple labels and a JComboBox. Below that JPanel, I added the JScrollPane with the JTree inside that.
It was the first JPanel that was limiting the JScrollPanel width.
I deleted the first JPanle and added those components to the mainPanel witht the JScrollPane below them. It now resizes correctly.