I'm trying to create a JFrame with a background image, a JLabel over the background image centered and toward the bottom, with two buttons on the right and left that say "Stay" and "Leave". This is already created. The issue arises with the order of each of the items. I cannot get the JLabel with text and buttons over the background image, with both of them showing. Here is my code; any advice would be appreciated. Thank you in advance.
public class SceneOne {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
JFrame SceneOne = new JFrame();
ImageIcon image = new ImageIcon(
"C:/Users/alan/Downloads/scary_forest_2.jpg");
JLabel imageLabel = new JLabel("", image, JLabel.CENTER);
JPanel panel = new JPanel(new BorderLayout());
panel.add(imageLabel, BorderLayout.CENTER);
SceneOne.add(panel);
SceneOne.setResizable(true);
imageLabel.setVisible(true);
SceneOne.pack();
JButton Leave=new JButton("Leave");
JButton Stay= new JButton ("Stay");
JPanel Leave1= new JPanel(new FlowLayout());
JPanel Stay1=new JPanel(new FlowLayout());
FlowLayout two = new FlowLayout(FlowLayout.LEFT);
FlowLayout three = new FlowLayout(FlowLayout.RIGHT);
Leave1.setLayout(two);
Stay1.setLayout(three);
Stay1.add(Leave);
Leave1.add(Stay);
Leave1.setOpaque(false);
Stay1.setOpaque(false);
SceneOne.add(Leave1);
SceneOne.add(Stay1);
JLabel label1 = new JLabel("Test");
SceneOne.add(label1);
label1.setText("<html><font color='red'> It was approximately 11:30 pm. The night sky was black not a single star piercing through the darkness"
+ "except the thick and powerful moonlight."
+ "<br>"
+ "You are alone leaving a costume party at a friend's place."
+ "It was rather boring and you decided to leave early."
+ "A stutter is heard and your"
+ "<br>"
+ "car begins to shake"
+ "Your headlights and car lights crack. The engine is left dead silent."
+ "You are left in a total silence"
+ "and baked in merely the moonlight."
+ "<br>"
+ "There is a mere second of silence till a harsh chill ripes through the"
+ "car like a bullet through paper. You are left dumbfounded. What do you do?</font><html>");
label1.setHorizontalAlignment(JLabel.CENTER);
label1.setVerticalAlignment(JLabel.BOTTOM);
label1.setVisible(true);
label1.setOpaque(false);
SceneOne.setComponentZOrder(panel, 0);
SceneOne.setComponentZOrder(label1, 0);
// SceneOne.setComponentZOrder(Leave1,0);
// SceneOne.setComponentZOrder(Stay1,0);
SceneOne.setSize(400,320);
SceneOne.setTitle("The Car");
SceneOne.setVisible(true);
SceneOne.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SceneOne.setLocation(500, 300);
}
}