@ -329,7 +329,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
width = Math . max ( width , calculateUIListMaxCellWidth ( uiList . getModel ( ) , uiList . getFontMetrics ( uiList . getFont ( ) ) ) ) ;
width = Math . max ( width , calculateUIListMaxCellWidth ( uiList . getModel ( ) , uiList . getFontMetrics ( uiList . getFont ( ) ) ) ) ;
}
}
iterator = nameEdListMap . entrySet ( ) . iterator ( ) ;
iterator = nameEdListMap . entrySet ( ) . iterator ( ) ;
width + = 4 0;
width + = 3 0;
while ( iterator . hasNext ( ) ) {
while ( iterator . hasNext ( ) ) {
Map . Entry < String , ListWrapperPane > entry = iterator . next ( ) ;
Map . Entry < String , ListWrapperPane > entry = iterator . next ( ) ;
ListWrapperPane wrapperPane = entry . getValue ( ) ;
ListWrapperPane wrapperPane = entry . getValue ( ) ;
@ -349,7 +349,8 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
} else {
} else {
text = element . toString ( ) ;
text = element . toString ( ) ;
}
}
width = Math . max ( width , fontMetrics . stringWidth ( text ) ) ;
//增加 10px 的左右间隔
width = Math . max ( width , fontMetrics . stringWidth ( text ) + 10 ) ;
}
}
}
}
return width ;
return width ;
@ -539,7 +540,8 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
label . setBackground ( Color . WHITE ) ;
label . setBackground ( Color . WHITE ) ;
label . setForeground ( Color . decode ( "#333334" ) ) ;
label . setForeground ( Color . decode ( "#333334" ) ) ;
label . setFont ( label . getFont ( ) . deriveFont ( 11F ) ) ;
label . setFont ( label . getFont ( ) . deriveFont ( 11F ) ) ;
label . setPreferredSize ( new Dimension ( 224 , 26 ) ) ;
//预留 10px 的纵向滚动条的宽度
label . setPreferredSize ( new Dimension ( 214 , 26 ) ) ;
this . nameEdList = nameEdList ;
this . nameEdList = nameEdList ;
this . add ( label , BorderLayout . NORTH ) ;
this . add ( label , BorderLayout . NORTH ) ;
this . add ( this . nameEdList , BorderLayout . CENTER ) ;
this . add ( this . nameEdList , BorderLayout . CENTER ) ;