I want to place a JLabel at a fixed x, y position on the ContentPane, with no effect. I have a JFrame, with a JPanel with a custom background picture as the content pane. And I'm adding the JLabel to the content pane. It appear at a fixed position at the top of the frame. That I want to change. I tried setBounds and setLocation with no effect. Any ideas?
This is the code to setup the JLabel:
congratulations = new JLabel();
//congratulations.setLocation(50, 260);
congratulations.setBounds(50, 260, 200, 30);
congratulations.setFont(new Font("Optima", 0, 24));
getContentPane().add(congratulations);
Thanks,
PR.