Java BufferedImage Display displayImageInWindow(BufferedImage image)

Here you can find the source of displayImageInWindow(BufferedImage image)

Description

display Image In Window

License

Minecraft Mod Public

Declaration

public static void displayImageInWindow(BufferedImage image) 

Method Source Code


//package com.java2s;
import java.awt.*;

public class Main {
    public static void displayImageInWindow(BufferedImage image) {
        // Use a JLabel in a JFrame to display the image
        javax.swing.JFrame frame = new javax.swing.JFrame();
        javax.swing.JLabel label = new javax.swing.JLabel(new javax.swing.ImageIcon(image));
        frame.getContentPane().add(label, BorderLayout.CENTER);
        frame.pack();/*from   ww w  .ja v  a2 s.c  o  m*/
        frame.setVisible(true);
    }
}

Related

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