JFrame frame = new JFrame(); JFrame frame2 = new JFrame(); frame.setTitle("Title name"); frame.setSize(600, 600); frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.getContentPane().setBackground(Color.RED); frame.setVisible(true); frame2.setUndecorated(true); frame2.setLocationRelativeTo(frame); frame2.getContentPane().setBackground(Color.BLACK); frame2.setVisible(true);