build JFrame - Java Swing

Java examples for Swing:JFrame

Description

build JFrame

Demo Code


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

public class Main {
    public static JFrame buildJFrame(JPanel panel) {
        JFrame frame = new JFrame("Quiz Card Builder");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(BorderLayout.CENTER, panel);
        frame.setSize(500, 600);/*w ww. j av a2s .  c o  m*/
        frame.setVisible(true);
        return frame;
    }
}

Related Tutorials