sun.awt.image.FileImageSource Java Examples

The following examples show how to use sun.awt.image.FileImageSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SunToolkit.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
static Image getImageFromHash(Toolkit tk,
                                           String filename) {
    checkPermissions(filename);
    synchronized (fileImgCache) {
        Image img = (Image)fileImgCache.get(filename);
        if (img == null) {
            try {
                img = tk.createImage(new FileImageSource(filename));
                fileImgCache.put(filename, img);
            } catch (Exception e) {
            }
        }
        return img;
    }
}
 
Example #2
Source File: SunToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static Image getImageFromHash(Toolkit tk,
                                           String filename) {
    checkPermissions(filename);
    synchronized (fileImgCache) {
        Image img = (Image)fileImgCache.get(filename);
        if (img == null) {
            try {
                img = tk.createImage(new FileImageSource(filename));
                fileImgCache.put(filename, img);
            } catch (Exception e) {
            }
        }
        return img;
    }
}
 
Example #3
Source File: SunToolkit.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
@Override
public Image createImage(String filename) {
    checkPermissions(filename);
    return createImage(new FileImageSource(filename));
}
 
Example #4
Source File: SunToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Image createImage(String filename) {
    checkPermissions(filename);
    return createImage(new FileImageSource(filename));
}