diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index c2d145983..acb69e6b3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -9,6 +9,8 @@ import com.fr.design.mainframe.FormDesigner; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; /** * Created by ibm on 2017/7/25. @@ -22,6 +24,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { this.initLayout(); this.initScrollPane(); this.initPropertyPane(); + content.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + content.requestFocusInWindow(); + } + }); } public void initPropertyPane() { @@ -45,6 +53,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { }; this.add(basicScrollPane, BorderLayout.CENTER); this.content = jPanel; + this.content.requestFocusInWindow(); } private void initLayout() {