|
SysTray for Java v2.4.1   |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object snoozesoft.systray4j.SysTrayMenuIcon
This class represents a platform specific icon file. The supported formats are *.ico on win32, and *.xpm on KDE. Usually on KDE the dimension of the icon is 24 x 24, and 16 x 16 or 32 x 32 on Windows.
Interested listeners are called whenever this icon is clicked.
Constructor Summary | |
SysTrayMenuIcon(java.lang.String iconFileName)
Creates a new SysTrayMenuIcon object. |
|
SysTrayMenuIcon(java.lang.String iconFileName,
java.lang.String actionCommand)
Creates a new SysTrayMenuIcon object.
|
|
SysTrayMenuIcon(java.net.URL icon)
Creates a new SysTrayMenuIcon object from
the file pointed to by the URL. |
|
SysTrayMenuIcon(java.net.URL icon,
java.lang.String actionCommand)
Creates a new SysTrayMenuIcon object from
the file pointed to by the URL. |
Method Summary | |
void |
addSysTrayMenuListener(SysTrayMenuListener listener)
Adds the specified listener to receive events from this icon. |
java.lang.String |
getActionCommand()
Getter for the action command. |
static java.lang.String |
getExtension()
This method returns the correct icon file extension for the actual platform. |
java.lang.String |
getName()
Getter for the file name associated with this object. |
void |
removeSysTrayMenuListener(SysTrayMenuListener listener)
Removes the specified listener so that it no longer receives events from this menu item. |
void |
setActionCommand(java.lang.String actionCommand)
Setter for the action command. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SysTrayMenuIcon(java.lang.String iconFileName)
Creates a new SysTrayMenuIcon
object.
Since the file extension (ico/xpm) depends on the actual platform, it is allowed, but not necessary to specify it.
Example:
  realFileName: duke.ico
  passedFileName: duke or duke.ico
iconFileName
- The associated file name.public SysTrayMenuIcon(java.lang.String iconFileName, java.lang.String actionCommand)
SysTrayMenuIcon
object.
Since the file extension (ico/xpm) depends on the actual platform, it is allowed, but not necessary to specify it.
Example:
  realFileName: duke.ico
  passedFileName: duke or duke.ico
iconFileName
- The associated file name.actionCommand
- The action command passed to the listeners.public SysTrayMenuIcon(java.net.URL icon)
Creates a new SysTrayMenuIcon
object from
the file pointed to by the URL.
This constructor makes it possible to store the icon files together with the application classes in a JAR file.
One possibility to get the URL of an icon is through the
getResource() method:
getClass().getResource( "duke" + SysTrayMenuIcon.getExtension() )
icon
- The URL of the icon.public SysTrayMenuIcon(java.net.URL icon, java.lang.String actionCommand)
Creates a new SysTrayMenuIcon
object from
the file pointed to by the URL.
This constructor makes it possible to store the icon files together with the application classes in a JAR file.
One possibility to get the URL of an icon is through the
getResource() method:
getClass().getResource( "duke" + SysTrayMenuIcon.getExtension() )
icon
- The URL of the icon.actionCommand
- The action command passed to the listeners.Method Detail |
public void addSysTrayMenuListener(SysTrayMenuListener listener)
listener
- The systray menu listener.public java.lang.String getActionCommand()
public static java.lang.String getExtension()
public java.lang.String getName()
public void removeSysTrayMenuListener(SysTrayMenuListener listener)
listener
- The systray menu listener.public void setActionCommand(java.lang.String actionCommand)
actionCommand
- The action command passed to the listeners.
|
SysTray for Java v2.4.1   |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |