Hello, Im Alvaro from Spain so Im sorry if my english is not good enough.

Im kind of new in Java and I expect you could solve my doutb.

The thing is I have several classes, each class represents a panel (a window with buttons).

In my main class (not the class that have the main method), it have an object for each window (with buttons). So, the object is a panel or window or whatever we want to call it, but from my main class I can not manage an event that come out when you press a button of that window. ¿Right?

If I want that when you press a button of one of the panels it changes something from the main class (modify an variable for example), ¿how can I do it?, because you manage the event in the class of the panel, but from there you can not modify or call a function of the main class (because you are an object in the main class).

I hope you understand what I mean and give me a solution.

Thank you in advance.