how to make a Component in a Custom Component react on the Main Page

Hello ,
I have made a Custom Component ‘Y’ that will appear in a Main Page ‘X’.
My Question is , how can a button in ‘Y’ add a Label in ‘X’.
i hope that my question is clear



Sounds like you need to give Y reference to X, either directly or through some listener or other component that has access to a method in X that adds the label.

For example, give a ClickListener as a parameter in Y’s constructor (or through some setter), where the ClickListener is either X itself that implements the interface, or a separate ClickListener that has been created somewhere where it has access to X.addLabel().