diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java index 028f6b3b4e..374efb1121 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java @@ -43,7 +43,7 @@ public class VerticalChoosePane extends ChoosePane implements DesignerBean { rs.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -RIGHTBORDER)); UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEFT); UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEFT); - UILabel l3 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), MAX_WIDTH); + UILabel l3 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), MAX_WIDTH, UILabel.LEFT); if (labelSize > 0) { Dimension pSize = new Dimension(labelSize, 20); l1.setPreferredSize(pSize); diff --git a/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java b/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java index 5770ed5e8a..6823b7b88f 100644 --- a/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java +++ b/designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java @@ -35,4 +35,17 @@ public class FRWidgetFactory { UIComponentUtils.setLineWrap(label, lineWidth); return label; } + + /** + * 创建一个可换行可调整水平对齐的 UILabel + * @param text + * @param lineWidth + * @param horizontalAlignment + * @return com.fr.design.gui.ilable.UILabel + */ + public static UILabel createLineWrapLabel(String text, int lineWidth, int horizontalAlignment) { + UILabel label = new UILabel(text, horizontalAlignment); + UIComponentUtils.setLineWrap(label, lineWidth); + return label; + } }