jFrame set size by import javax.swing.JFrame; class SizeJFrame { public static void main(String[] args) { JFrame frame = new JFrame(); //Set width and height frame.setSize(400,500); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }import javax.swing.JFrame; class SizeJFrame { public static void main(String[] args) { JFrame frame = new JFrame(); //Set width and height frame.setSize(400,500); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } } Please Share