FileChooser: fixed layout of (optional) accessory component and fixed too large right margin (issue #604; regression since implementing PR #522 in FlatLaf 2.3)

This commit is contained in:
Karl Tauber
2022-10-21 13:12:52 +02:00
parent f215356629
commit b24e2db59e
4 changed files with 156 additions and 35 deletions

View File

@@ -243,11 +243,13 @@ public class FlatFileChooserUI
borderLayout.setHgap( 8 );
Component north = borderLayout.getLayoutComponent( BorderLayout.NORTH );
Component lineEnd = borderLayout.getLayoutComponent( BorderLayout.LINE_END );
Component center = borderLayout.getLayoutComponent( BorderLayout.CENTER );
Component south = borderLayout.getLayoutComponent( BorderLayout.SOUTH );
if( north != null && center != null && south != null ) {
if( north != null && lineEnd != null && center != null && south != null ) {
JPanel p = new JPanel( new BorderLayout( 0, 11 ) );
p.add( north, BorderLayout.NORTH );
p.add( lineEnd, BorderLayout.LINE_END );
p.add( center, BorderLayout.CENTER );
p.add( south, BorderLayout.SOUTH );
fc.add( p, BorderLayout.CENTER );