The com.pump.image.NSImage
class identifies several images available only on Mac.
Here are a few ways to access the image titled "Computer":
Image img1 = NSImage.Computer.getImage(); Image img2 = NSImage.Computer.getImage(new Dimension(64, 64)); BufferedImage img3 = NSImage.Computer.getBufferedImage(); BufferedImage img3 = NSImage.Computer.getBufferedImage(new Dimension(64, 64));
The default Mac toolkit (the sun.lwawt.macosx.LWCToolkit
) has special logic to intercept all requests for images that start with the prefix "NSImage://NS". You don't actually need the com.pump.image.NSImage
class to access this feature on Mac; this demo primary exists as a reminder of what images are available.
The fields in NSImage are not meant to be an exhaustive list. You may be able to request some images not listed here.
The images may change from one OS release to another, so it's important that you choose them for their intended usage and not for their actual image.
If you attempt to invoke any NSImages on another platform you may get an exception or an empty image.