public class SwingIcon extends java.lang.Object implements javax.swing.Icon, SwingResource
javax.swing.Icon.
The icon is either loaded from the classpath using
new ImageIcon(classLoader.getResource(name)),
from the file system using new ImageIcon(name)
or from the current look and feel using UIManager.getIcon(name).| Modifier and Type | Field and Description |
|---|---|
static int |
CLASSPATH |
static int |
FILE |
static int |
SWING |
| Constructor and Description |
|---|
SwingIcon(int type,
java.lang.String name)
Constructs a icon.
|
| Modifier and Type | Method and Description |
|---|---|
javax.swing.Icon |
createIcon(java.lang.ClassLoader loader)
For internal use only.
|
boolean |
equals(java.lang.Object obj)
Determines whether another object is equal to this object.
|
int |
getIconHeight() |
int |
getIconWidth() |
java.lang.String |
getName()
Returns the icon name.
|
int |
getType()
|
int |
hashCode()
Returns the hash code for this object.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
java.lang.String |
toString()
Returns a string representation of the object.
|
public static final int CLASSPATH
public static final int FILE
public static final int SWING
public SwingIcon(int type,
java.lang.String name)
type - The icon type (CLASSPATH, FILE or SWING).name - The icon name.
A resource name (see java.lang.ClassLoader.getResource(String))
if type is CLASSPATH, a file name (see javax.swing.ImageIcon(String))
if type is FILE or a key (see javax.swing.UIManager.getIcon(String))
if type is SWING.public int getType()
public java.lang.String getName()
public javax.swing.Icon createIcon(java.lang.ClassLoader loader)
public int getIconWidth()
getIconWidth in interface javax.swing.Iconpublic int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
paintIcon in interface javax.swing.Iconpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright (C) 2004-2017 FormDev Software GmbH. All rights reserved.