Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.awt.image.BufferedImage;

import javax.swing.ImageIcon;

import javax.swing.JFrame;

import javax.swing.JLabel;

public class Main {
    public static JFrame getImageJFrame(BufferedImage image) {
        ImageIcon icon = new ImageIcon();
        icon.setImage(image);
        JFrame frame = new JFrame();
        frame.add(new JLabel(icon));
        frame.pack();
        return frame;
    }
}