title: Java: pass an event to another component
body: <p>Sorry I don't know  if this is very clear, but I'm pretty new to Java.</p>
  
  <p>So I have a JFrame with a BorderLayout containing a JPanel and a JButton.</p>
  
  <p>What I want to do is when something happens in my JPanel, I want for example change the text of the JButton, or enable/disable it. How would I do that? How can I access the JButton from the JPanel? I know some ways of doing it but I don't think they're the best way to do it.</p>
  
  <p>What would be the best way to do this?</p>
  
  <p>Thanks in advance</p>