I'am creating simple application with GUI and I'am having pannels as individual classes that are included in MainFrame. I am asking here for the right approach, how should panels that are in separated classes communicate like in example: i have button in panel1 and textarea in panel2, i want to click on a button to append some string in textarea but those are individual components(classes). Button1 doesnt have textarea in his scope. I know i can set getter for button and add listener in class i need it but I want here right approach so any help is appreciated!
Swing basically revolves around the MVC pattern. In your case the views would be the components and the controller might be a combination of listeners and an actual controller class that knows all the views. The model depends on your application and specific needs.
If a button just needs to update a single textarea a listener probably would be sufficient. Just pass a reference to the textarea that should be updated to the listener.
Here's an oracle tutorial on MVC: http://www.oracle.com/technetwork/articles/javase/index-142890.html