org/homelinux/largo/utils/ImgComponent.java
changeset 0 e0dbaef72362
child 7 93fe1f21e0d8
new file mode 100644
--- /dev/null
+++ b/org/homelinux/largo/utils/ImgComponent.java
@@ -0,0 +1,31 @@
+package org.homelinux.largo.utils;
+
+import java.awt.Canvas;
+import java.awt.Dimension;
+import java.awt.Image;
+import java.net.URL;
+
+import javax.swing.ImageIcon;
+
+public class ImgComponent extends Canvas {
+	static final long serialVersionUID = 140208;
+	private Image img = null;
+
+	public ImgComponent (String sFile) {
+		ClassLoader cl = getClass ().getClassLoader ();
+		URL url = cl.getResource (sFile);
+		img = new ImageIcon (url).getImage ();
+	}
+
+	public Image getImage () {
+		return img;
+	}
+
+	public Dimension getPreferredSize () {
+		return new Dimension (img.getWidth (this), img.getHeight (this));
+	}
+
+	public Dimension getMinimumSize () {
+		return getPreferredSize ();
+	}
+}