!7 p-awt { new JWindow f; f.setAlwaysOnTop(true); int alpha = 128; f.setBackground(new Color(0,255,0, alpha)); //f.setSize(512, 512); f.setBounds(200, 300, 400, 500); f.add(new JPanel { protected void paintComponent(Graphics g) { g.setColor(Color.RED); g.drawRect(0, 0, 511, 511); } }); //f.setLocationRelativeTo(null); f.setVisible(true); }