Java Image openImage()

Here you can find the source of openImage()

Description

open Image

License

Open Source License

Declaration

public static BufferedImage openImage() 

Method Source Code


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

import javax.imageio.ImageIO;
import javax.swing.*;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class Main {
    public static BufferedImage openImage() {
        BufferedImage image = null;
        File file;//from  w ww.  ja  v a  2 s .  c  om
        JFileChooser fC = new JFileChooser(new File("."));
        if (JFileChooser.APPROVE_OPTION == fC.showOpenDialog(null)) {
            file = fC.getSelectedFile();
            try {
                image = ImageIO.read(file);
            } catch (IOException e) {
            }
        }
        return image;
    }
}

Related

  1. initVistaDragTextureImage()
  2. isContinueImageUpdate(JComponent comp, Image img)
  3. loadImage(byte[] imgStr, int imageSize)
  4. makeColorTransparent(Image im, Color c)
  5. mask(Image img, Color color)
  6. openImageFileChooser(Component com)
  7. paintToImage(Component comp)
  8. prepareImagePath(String html, URL url)
  9. removeImage(JLabel image)