diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java index f4e977ae6..fa56280e8 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java @@ -32,6 +32,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.MouseAdapter; @@ -84,6 +85,7 @@ public class NewFormPane extends BasicPane { }); dialog.setSize(new Dimension(900, 600)); GUICoreUtils.centerWindow(dialog); + dialog.setTitle(this.title4PopupWindow()); dialog.setResizable(false); dialog.setVisible(true); } @@ -93,7 +95,14 @@ public class NewFormPane extends BasicPane { list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.setModel(initListModel()); list.setSelectedIndex(0); - list.setCellRenderer(new DefaultListCellRenderer()); + list.setCellRenderer(new DefaultListCellRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); + return this; + } + }); list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { @@ -142,9 +151,9 @@ public class NewFormPane extends BasicPane { private JPanel createNewTemplatePane() { EmptyLayoutPane jPanel = new EmptyLayoutPane(); - jPanel.addClickListener(new MouseAdapter() { + jPanel.addMouseListener(new MouseAdapter() { @Override - public void mouseClicked(MouseEvent e) { + public void mousePressed(MouseEvent e) { setSelectedLayoutPane(jPanel); dialog.setButtonEnabled(true); } @@ -229,9 +238,9 @@ public class NewFormPane extends BasicPane { layoutPaneMap.put(moduleName, module); for (PredefinedLayout layout : layouts) { PredefinedLayoutPane predefinedLayoutPane = new PredefinedLayoutPane(layout); - predefinedLayoutPane.addClickListener(new MouseAdapter() { + predefinedLayoutPane.addMouseListener(new MouseAdapter() { @Override - public void mouseClicked(MouseEvent e) { + public void mousePressed(MouseEvent e) { setSelectedLayoutPane(predefinedLayoutPane); dialog.setButtonEnabled(true); }