title: Java; Accessing Member Instance Variables From Another Class
body: <p>I have the following structure:</p>
  
  <pre><code>public class A {
       private javax.swing.JLabel fullName;
  
       public class B {
               public B() {
                      fullName.setText("Martha Stewart");
               }
       }
       ...
       ...
       ...
  }
  </code></pre>
  
  <p>My goal is to have B (currently the sub class of A) to be in a separate class.  </p>
  
  <p>The problem is: When I separate the two classes, I lose functionality on the .setText() call for the JLabel.  I realize that if B is in a separate class, I would have to write a public setter method in class A.  </p>
  
  <p>This, however, is not plausible since I have about 100 buttons and use 4-5 different functions for each button.  Creating a getter/setter method for each function is not plausible IMHO.  </p>
  
  <p>I'm trying to wrap my head around a better solution... can any of you help, friends?</p>