You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We sometimes use nested panels to build and reuse parts of gui. For these nested panels we use MigLayout with zero insets so these panels wont stand out in terms of sizes and insets. The problem is that outer border isnt painting on the panel's edges.
Here is an example on FlatIntelliJLaf - rootPanel with standard insets with added combobox and two nested panels (zero insets) with one and two components respectively. The focus on the first component looks fine, while others have issues
JPanel rootPanel = new JPanel(new MigLayout("insets n n n n"));
JPanel nestedPanel1 = new JPanel(new MigLayout("insets 0 0 0 0"));
nestedPanel1.add(new JComboBox<>(), "grow");
JPanel nestedPanel2 = new JPanel(new MigLayout("insets 0 0 0 0"));
nestedPanel2.add(new JComboBox<>(), "grow,wrap");
nestedPanel2.add(new JTextField(), "grow");
rootPanel.add(new JComboBox<>(), "grow,wrap");
rootPanel.add(nestedPanel1,"grow,wrap");
rootPanel.add(nestedPanel2,"grow");
JFrame jFrame = new JFrame();
jFrame.add(rootPanel);
jFrame.pack();
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setResizable(true);
jFrame.setVisible(true);
The text was updated successfully, but these errors were encountered:
Turning off MigLayout visualPadding on nested panels isn't much help here as it usually inflates sizes of other components in same row/column and creates bigger insets between components on nested panel while other insets stay the same
Turning zero insets to non-zero in case of the pic above will create non equal vertical insets between the components
Maybe you are now aware of some other FlatLaf or MigLayout related workarounds? Maybe some MigLayout lifehack, which i can use to keep all the visual insets the same in case of panels with nested zero-insets panels?
We sometimes use nested panels to build and reuse parts of gui. For these nested panels we use MigLayout with zero insets so these panels wont stand out in terms of sizes and insets. The problem is that outer border isnt painting on the panel's edges.
Here is an example on FlatIntelliJLaf - rootPanel with standard insets with added combobox and two nested panels (zero insets) with one and two components respectively. The focus on the first component looks fine, while others have issues
The text was updated successfully, but these errors were encountered: