I have a JFrame
with GridBagLayout
. On this frame I have JToolBar
and JPanel
. The problem appeared when I dropped tool bar back. In an answer to JToolBar IllegalArgumentException when dropped back into GridBagLayout it says that the container for tool bar must be with BorderLayout
. Ok, I thought and added one more panel (with BorderLayout
) to frame and tool bar to panel. So I have
[JFrame [JPanel1[JToolBar]] [JPanel2]]
Everything works. But now I have a problem - I can't set JPanel1
height so it to be equal to tool bar height and to disappear and appear. I only have weighty as I see, but it's coefficient.
How to solve it?