import javax.swing.*; import java.awt.*; class Program extends JFrame { JPanel panel1; Program() { panel1 = new JPanel(); panel1.setSize(200, 200); panel1.setLocation(50, 50); panel1.setBackground(Color.blue); this.setLayout(null); this.getContentPane().add(panel1); this.setSize(800, 600); this.setLocationRelativeTo(null); this.setVisible(true); } public static void main(String args[]) { new Program(); } }