java simple jframe example

Solutions on MaxInterview for java simple jframe example by the best coders in the world

showing results for - "java simple jframe example"
Ignacio
30 Feb 2020
1import javax.swing.*;
2import java.awt.FlowLayout;
3import java.awt.GridBagConstraints;
4import java.awt.GridBagLayout;
5import java.awt.Insets;
6import java.awt.event.*;
7 
8public class JFrameExample{
9     
10    public static void main(String[] args){
11        // Create frame with title Registration Demo
12        JFrame frame= new JFrame(); 
13        frame.setTitle("JFrame Demo");
14        frame.pack();
15        frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
16        frame.setLocationRelativeTo(null);
17        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
18        frame.setVisible(true);
19    }
20}
21