Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.awt.Component;

import javax.swing.JFrame;

import javax.swing.WindowConstants;

public class Main {
    static public void show(Component panel) {
        JFrame frame = new JFrame();
        frame.setTitle("TestForm");
        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        frame.getContentPane().add(panel);
        frame.pack();
        frame.show();
    }
}