How can I achieve this effect using Swing:
When resizing of the width the JFrame
, I want the blue JPanel
to be fluid and the green JPanel
to be fixed. When resizing the height, I want both to be fixed. I also want the blue JPanel
to not have less than some predefined width and the green JPanel
to never move under the blue JPanel
, remaining always on the right.
The MigLayout was designed for these situations: http://www.miglayout.com/
JPanel panel = new JPanel();
panel.setLayout(new MigLayout(
"",
"[grow][200px]", // Column constraints
"[100px]" // Row constraints
));