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.
33 lines
860 B
33 lines
860 B
4 months ago
|
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 11.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) {
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
}
|