diff --git a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java index af4bc8a9b..393f217ce 100644 --- a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java @@ -3,13 +3,13 @@ package com.fr.design.cell; import com.fr.base.NameStyle; import com.fr.base.ScreenResolution; import com.fr.base.Style; +import com.fr.general.IOUtils; import javax.swing.JPanel; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.Toolkit; +import java.awt.image.BufferedImage; /** * @author Starryi @@ -18,7 +18,7 @@ import java.awt.Toolkit; */ public class CellStylePreviewPane extends JPanel { - private static final Image transparentBackgroundImage = Toolkit.getDefaultToolkit().createImage(CellStylePreviewPane.class.getResource("/com/fr/design/images/transparent_background.png")); + private static final BufferedImage transparentBackgroundImage = IOUtils.readImage("/com/fr/design/images/transparent_background.png"); private final float transparentBackgroundWidth; private final float transparentBackgroundHeight; private String paintText = "Report"; @@ -38,7 +38,7 @@ public class CellStylePreviewPane extends JPanel { } @Override - public void paintComponent(Graphics g) { + public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; int resolution = ScreenResolution.getScreenResolution();