From c50f5ba51323911f1a0d46e27ea8aff273f41e53 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 14 Oct 2016 18:56:58 +0800 Subject: [PATCH] rt --- .../com/fr/design/mainframe/ShareWidgetButton.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java index 3054bea328..e1e1844671 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java @@ -46,16 +46,18 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot private void initUI() { this.setBackground(Color.WHITE); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - setPreferredSize(new Dimension(110, 70)); + setPreferredSize(new Dimension(108, 72)); setLayout(FRGUIPaneFactory.createBorderLayout()); ImagePanel imagePanel = new ImagePanel((BufferedImage) bindInfo.getCover()); + imagePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.add(imagePanel, BorderLayout.NORTH); JPanel panel = new JPanel(); + panel.setPreferredSize(new Dimension(108, 20)); UILabel label = new UILabel(bindInfo.getName(), SwingConstants.HORIZONTAL); - panel.setBackground(new Color(184, 220, 242)); - panel.add(label); - this.add(panel, BorderLayout.SOUTH); + label.setOpaque(true); + label.setBackground(new Color(184, 220, 242)); + this.add(label, BorderLayout.SOUTH); } private class ImagePanel extends JPanel { @@ -64,12 +66,12 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot public ImagePanel(BufferedImage image) { this.image = image; - this.setPreferredSize(new Dimension(110, 50)); + this.setPreferredSize(new Dimension(108, 52)); } @Override public void paintComponent(Graphics g) { - g.drawImage(image, 0, 0, 110, 70, null); + g.drawImage(image, 0, 0, null); } }