Change swing components from another Frame

I'm trying to make a GUI application in which I will open a second frame and then from that frame interact with some of the components from the first GUI but I have a problem with that. I don't know how to access these components in order to change them. I tried making setters and getters but it didn't work. Also the second frame extends first frame. I thought that by making the second frame a child of the first one would solve this without any problem but that's not the case. I also tried making all my filed variables as public thinking that might be a problem but nothing is changed. I've been trying to make this for 4 hours now but I can't make it happen. I googled and read here on stackoverflow but I couldn't find a solution.

For a testing purposes I made a new project in which in my first frame, called GUI, I have one label and two buttons.

By clicking on the first button label is set to "Clicked" and clicking on second button opens a new frame called GUI2. In GUI2 there's one button that's supposed to change label text in GUI to "Clicked from second frame" but that's not happening. Here's the code.

public class GUI extends JFrame {

    public JPanel mainPanel2;
    public JButton button1;
    public JLabel label;
    public JButton button2;

    //constructor
    public GUI(){
        initUI();

        //changes label to write "Clicked"
        button1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                label.setText("Clicked");
            }
        });

        //opens a new frame
        button2.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new GUI2();
            }
        });
    }

    public JLabel getLabel(String text) {
        label.setText(text);
        return label;
    }

    public void setLabel(JLabel label) {
        this.label = label;
    }

    //creates frame
    private void initUI(){

        setContentPane(mainPanel2);
        setSize(400,300);
        setTitle("Progress Bar");
        setLocationRelativeTo(null);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setVisible(true);
    }
}

  //second class
  public class GUI2 extends GUI{
    private JButton button1;
    private JPanel mainPanel2;

    //constructor
    public GUI2() {

        initUI();

        //this one should change label from the other class
        button1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                label.setText("Clicked from another Frame");
            }
        });
    }

    //creates second frame
    private void initUI(){

        setContentPane(mainPanel2);
        setSize(400,300);
        setTitle("Progress Bar");
        setLocationRelativeTo(null);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setVisible(true);
    }
}