Java BufferedImage Display displayImage(final String windowTitle, final BufferedImage image)

Here you can find the source of displayImage(final String windowTitle, final BufferedImage image)

Description

display Image

License

Open Source License

Declaration

public static void displayImage(final String windowTitle, final BufferedImage image) 

Method Source Code

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

import javax.swing.*;

import java.awt.image.BufferedImage;

public class Main {
    public static void displayImage(final BufferedImage image) {
        displayImage("", image);
    }/*from  w w  w . j a  va  2s . c  o m*/

    public static void displayImage(final String windowTitle, final BufferedImage image) {
        new JFrame(windowTitle) {
            {
                final JLabel label = new JLabel("", new ImageIcon(image), 0);
                add(label);
                pack();
                setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                setVisible(true);
            }
        };
    }
}

Related

  1. display(final BufferedImage image)
  2. displayImage(BufferedImage image)
  3. displayImage(final BufferedImage bufferedImage, final String title)
  4. displayImageInWindow(BufferedImage image)
  5. displayImageInWindow(BufferedImage image)
  6. displayImagePopup(BufferedImage img)