I want to thank you for the help so far and now I have come across another issue. I can make a background Panel just fine and placing Panels with Labels as well. I would like to stack either a Panel with Label over another Panel with Label. Or Stack Labels one on top of another. So it would be Background then JPanel with Label on top of the background and another JPanel with Label on top of the first JPanel with Label.
The start of my code that is working right now is below:
// SWITCH 1
switch1 = new JPanel();
switch1.setLocation(24,348);
switch1.setSize(55,83);
switch1.setOpaque(false);
background.add(switch1);
sw1 = new JLabel();
sw1.setIcon(SW1);
sw1.setLocation(0,0);
switch1.add(sw1);
pack();
I would like to add either a smaller JPanel with JLabel on top of this one. Is that possible? I tried several ways and it does not work one way I tried was this:
// SWITCH 2
switch2 = new JPanel();
switch2.setLocation(24,348);
switch2.setSize(45,73);
switch2.setOpaque(false);
switch1.add(switch2);
sw2 = new JLabel();
sw2.setIcon(SW2);
sw2.setLocation(0,0);
switch2.add(sw2);
pack();
That does NOT work. Thanks in advance for helping me solve this.