Is there anyone who can help me with groupLayout? Please help me.

I have two classes with GroupLayout and one class (Layer1) has a button, when I press the button it removes the Layer1 using removeAll () and creates an object for the layer2 and validate (). but the problem is the button disappears but the second layer does not appear.

I have posted this problem once before with codes but all people suggested me to change the layout since there are not a lot of people who knows about GroupLayout. So Please if there are anyone who knows about the GroupLayout reply then I can link or post my code with the problem. Please please help.