Question about java transperancy
I'm trying to make it so that my JPanel is transparent and shows the frame behind it (it's background is green). But when i start the program the JPanel is there and i see no green. Here is my code
public static void main (String [] args)
{
frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new GridBagLayout());
panel.setOpaque(false);
frame.getContentPane().add(panel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
frame.setBackground(Color.green);
}

