diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java index a25ca05046..7f43c57dfa 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java @@ -92,6 +92,9 @@ public class XCardAddButton extends XButton { if(cardLayout == null && tagLayout ==null ){ initRelateLayout(); } + if (cardLayout == null) { + throw new IllegalArgumentException("cardLayout can not be null"); + } int index = cardLayout.toData().getWidgetCount(); //添加新的tab,并将原来的设为未选中状态 diff --git a/designer-form/src/main/java/com/fr/design/form/layout/FRTitleLayout.java b/designer-form/src/main/java/com/fr/design/form/layout/FRTitleLayout.java index 413cbf2421..0ba996258a 100644 --- a/designer-form/src/main/java/com/fr/design/form/layout/FRTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/form/layout/FRTitleLayout.java @@ -126,11 +126,13 @@ public class FRTitleLayout implements FRLayoutManager, LayoutManager{ int titleH = title==null ? 0 : WTitleLayout.TITLE_HEIGHT; for (int i=0; i< target.getComponentCount(); i++) { Component comp = target.getComponent(i); - if (comp == title) { - comp.setBounds(0, 0, width, WTitleLayout.TITLE_HEIGHT); - } else if (comp == body) { - int y = titleH+gap; - comp.setBounds(0, y, width, height-y); + if (comp != null) { + if (comp == title) { + comp.setBounds(0, 0, width, WTitleLayout.TITLE_HEIGHT); + } else if (comp == body) { + int y = titleH + gap; + comp.setBounds(0, y, width, height-y); + } } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 3c03ba38d7..07cb7f93a3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -573,8 +573,8 @@ public class EditingMouseListener extends MouseInputAdapter { GUICoreUtils.showPopupMenu(cellPopupMenu, designer, e.getX(), e.getY()); } } + creator.doLayout(); } - creator.doLayout(); LayoutUtils.layoutRootContainer(designer.getRootComponent()); }