All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.swing.ImageIcon Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.6.8
Show newest version
package javax.swing;

import java.awt.*;

public class ImageIcon implements Icon {
	Image image;

	public ImageIcon() {
	}

	public ImageIcon(Image image) {
		this.image = image;
	}

	public void setImage(Image image) {
		this.image = image;
	}

	public Image getImage() {
		return image;
	}

	@Override
	public void paintIcon(Component c, Graphics g, int x, int y) {
		g.drawImage(image, x, y, c);
	}

	@Override
	public int getIconWidth() {
		return (image != null) ? image.getWidth(null) : 0;
	}

	@Override
	public int getIconHeight() {
		return (image != null) ? image.getHeight(null) : 0;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy