I would like to know how to change the background color (setBackground) of a JLabel by pressing a button from another window.
(JLabel in class Window1)
lblLuzC = new JLabel("");
lblLuzC.setOpaque(true);
lblLuzC.setBackground(Color.RED);
lblLuzC.setBounds(204, 224, 16, 16);
contentPane.add(lblLuzC);
(JButton in class Ventana2)
btnColor = new JButton("Cambiar color");
btnColor.setBounds(144, 85, 95, 23);
contentPane.add(btnColor);
btnColor.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
});