public class ResourceIcon
extends java.lang.Object
implements javax.swing.Icon
org.apache.myfaces.trinidad.webapp.ResourceServlet.
ResourceServlet looks for icons relative to the META-INF
directory of a JAR file. Consequently it is recommended that you put your
images under the META-INF directory
If you want to store your images in a different location in your JAR files,
you can do so, but you must also provide a suitable resource servlet that
can load them.| Constructor and Description |
|---|
ResourceIcon(java.lang.String source)
Constructor
The source URI for a ResourceIcon is the absolute path from the root of the
JAR file to the image.
|
ResourceIcon(java.lang.String source,
java.lang.String description)
Constructor
The source URI for a ResourceIcon is the absolute path from the root of the
JAR file to the image.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescription()
Returns the description of this icon.
|
int |
getIconHeight() |
int |
getIconWidth() |
java.lang.String |
getRuntimeUri()
Returns the runtime URI for the icon.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
public ResourceIcon(java.lang.String source)
source - the absolute path from the root of your jar file to the image.public ResourceIcon(java.lang.String source,
java.lang.String description)
source - the absolute path from the root of your jar file to the image.description - description of the iconpublic 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 java.lang.String getRuntimeUri()
public java.lang.String getDescription()