Java BufferedImage to ImageIcon getImageIcon(final BufferedImage image)

Here you can find the source of getImageIcon(final BufferedImage image)

Description

Converts the image to an imageicon.

License

Open Source License

Parameter

Parameter Description
image a parameter

Exception

Parameter Description
Exception an exception

Declaration

public static ImageIcon getImageIcon(final BufferedImage image) throws Exception 

Method Source Code

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

import java.awt.image.BufferedImage;

import javax.swing.ImageIcon;

public class Main {
    /**//from ww w  .  j a va  2 s  . co  m
     * Converts the image to an imageicon.
     * @param image
     * @return
     * @throws Exception
     */
    public static ImageIcon getImageIcon(final BufferedImage image) throws Exception {
        return new ImageIcon(image);
    }
}

Related

  1. getImageIcon(BufferedImage img)
  2. scaleImageToIconImage(final BufferedImage img, final int maxHeight, final int maxWidth, final boolean preserveAspectRatio, final boolean doHighQuality)
  3. toSwingImage(final BufferedImage image)