ingenias.editor.rendererxml.JLabelIcon Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ingened Show documentation
Show all versions of ingened Show documentation
Meta-language editor built over INGENME. It is the most basic editor to be used in the rest of projects
package ingenias.editor.rendererxml;
import javax.swing.JLabel;
import javax.swing.Icon;
import java.awt.*;
import java.net.*;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2004
* Company:
* @author not attributable
* @version 1.0
*/
public class JLabelIcon extends JLabel {
public String iconName="";
public JLabelIcon() {
}
public String getIconName(){
return iconName;
}
public void setIconName(String name){
try {
super.setIcon(new javax.swing.ImageIcon(new java.net.URL(name)));
}
catch (MalformedURLException ex) {
System.err.println(name);
// ex.printStackTrace();
}
this.iconName=name;
}
public void setIcon(Icon icon){
if (icon!=null && (icon instanceof javax.swing.ImageIcon)){
this.setIconName(icon.toString());
}
super.setIcon(icon);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy