I have this \"main\" panel (let\'s call it AAA) with BorderLayout, and two panels (BBB and CCC) in it:
public class AAA extends JPanel {
I managed to do this. I simply passed the Center panel as a parameter in the North panel's constructor. It works perfectly. Thank you all for the answers :)
You may be thinking about this wrong. It's perhaps better to think not of two JPanel's that are communicating, but rather more simply two objects that are communicating, and they will communicate just the same as any other two objects -- via methods that affect state. This information can be pushed from one object to the other by having the one object call the methods of the other and publish its information to it, or it can be pulled from one object to another by using the observer design pattern such as can be achieved with one of the various listeners that are available. Myself, I like using a PropertyChangeListener for this. So the observed object will accept listeners that are notified once its state has been changed, and these observers will then call public methods of the observed to extract the changed information.
For example, please check out the code in this answer or perhaps even better the answer to this question.