帆软报表设计器源代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
998 B

package com.fine.component.popup;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.ImageIcon;
import java.awt.BorderLayout;
import java.util.Objects;
/**
* 图片遮罩层,支撑静态图片及动态GIF
*
* @author Levy.Xie
* @since 12.0
* Created on 2024/12/20
*/
public class ImageChild extends GlassPaneChild {
private static final String DEFAULT_LOADING_PATH = "com/fine/component/pop/loading.gif";
public ImageChild() {
this(DEFAULT_LOADING_PATH);
}
public ImageChild(String imgPath) {
this(imgPath, true);
}
public ImageChild(String imgPath, boolean transparent) {
this.transparent = transparent;
setLayout(new BorderLayout());
setBorder(new ScaledEmptyBorder(8, 8, 8, 8));
ImageIcon icon = new ImageIcon(Objects.requireNonNull(getClass().getClassLoader().getResource(imgPath)));
add(new UILabel(icon), BorderLayout.CENTER);
}
}