![JAR search and dependency download from the Maven repository](/logo.png)
com.habibsweb.commons.components.ImageLabel Maven / Gradle / Ivy
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.habibsweb.commons.components;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
/**
* A JLabel that has the size of the provided ImageIcon
*
* @author David Hamilton
*/
public class ImageLabel extends JLabel {
/**
* Constructs a new ImageLabel
with a provided
* ImageIcon
*
* @param icon a provided ImageIcon
*/
public ImageLabel(ImageIcon icon) {
setSize(icon.getImage().getWidth(null), icon.getImage().getHeight(null));
setIcon(icon);
setIconTextGap(0);
setBorder(null);
setText(null);
setOpaque(false);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy