MCPcopy Create free account
hub / github.com/dorkbox/SystemTray / setImage

Method setImage

src/dorkbox/systemTray/MenuItem.java:283–291  ·  view source on GitHub ↗

Specifies the new image to set for a menu entry, NULL to delete the image. This method will cache the image if it needs to be resized to fit. @param imageFile the file of the image to use or null

(final File imageFile)

Source from the content-addressed store, hash-verified

281 * @param imageFile the file of the image to use or null
282 */
283 public
284 void setImage(final File imageFile) {
285 this.unknownImage = imageFile;
286
287 if (peer != null) {
288 realizeImageFile(); // imageResizeUtil is set in the 'bind' call (which is also when peer is assigned)
289 ((MenuItemPeer) peer).setImage(this);
290 }
291 }
292
293 /**
294 * Specifies the new image to set for a menu entry, NULL to delete the image

Callers 4

TestTrayMethod · 0.95
TestTraySwtMethod · 0.95
doJavaFxStuffMethod · 0.95
MenuItemMethod · 0.95

Calls 2

realizeImageFileMethod · 0.95
setImageMethod · 0.65

Tested by 3

TestTrayMethod · 0.76
TestTraySwtMethod · 0.76
doJavaFxStuffMethod · 0.76