Java Image Create createImage(URL url, String description, boolean checkPresence)

Here you can find the source of createImage(URL url, String description, boolean checkPresence)

Description

create Image

License

Open Source License

Declaration

public static Image createImage(URL url, String description, boolean checkPresence) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Image;
import java.net.URL;
import javax.swing.ImageIcon;

public class Main {
    public static Image createImage(URL url, String description, boolean checkPresence) {
        return createImageIcon(url, description, null, null).getImage();
    }/*ww  w.jav a 2 s .c  o m*/

    public static ImageIcon createImageIcon(URL url, Integer w, Integer h) {
        return createImageIcon(url, null, w, h);
    }

    public static ImageIcon createImageIcon(URL url, String description, Integer w, Integer h) {
        ImageIcon imageIcon = new ImageIcon(url, description);
        if (w != null && h != null) {
            imageIcon = new ImageIcon(imageIcon.getImage().getScaledInstance(w, h, java.awt.Image.SCALE_SMOOTH));
        }
        return imageIcon;
    }
}

Related

  1. createImage(byte[] data)
  2. createImage(Component comp, Icon icon)
  3. createImage(Icon icon)
  4. createImage(JPanel panel)
  5. createImage(String str)
  6. createImageCopy(Image image)
  7. createImageFromBase64String(String s)
  8. createImageFromInvisibleComponent(JComponent component)
  9. createImageFromVisibleComponent(JComponent comp, int cw, int ch)