import java.net.*; import java.io.*; import javax.swing.*; import java.util.regex.*; import java.util.*; import java.awt.*; import java.util.List; public class main { public static void main(String[] args) { JFrame frame = new JFrame("A JavaX Frame"); JPanel panel = new JPanel(); frame.add(panel); frame.setBounds(100, 100, 500, 400); frame.setVisible(true); exitOnFrameClose(frame); } static void exitOnFrameClose(JFrame frame) { frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }