Class cannot find variables in abstract class

TheVeee
TheVeee used Ask the Experts™
on
I have two classes CientGui and Test. ClientGui is a abstract and is in package test.tm and then the other class Test is public and extends ClientGui and is in package test.tm.dynm.  Problem Im getting is that when I try to reference a variable in Test from class ClientGui, I get Field is not visible but my editor when I go to declaration.. goes directly to ClientGui and shows me it.  If I change the ClientGui class from a abstract to public... everthing works fine.  The ClientGui class is the base of everything and Im worried about changing the "behavior" from a abstract class to a public class due to the ramifications since it used by gobs of our existing code.  Question is... How do I get it visible the way it stands today as a abstract class to the the Test Class?

Test.java....
package test.tm.dynm;

/**
 public class Test extends ClientGui {
{
}
==============================================================================
ClientGui.java...
package test.tm;
*      This is an abstract class serving as a super class for single table manipulations.
*
*/
public abstract class ClientGui
      extends JPanel
      implements ActionListener, ArcTable {
stuff in side
}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Given the following two classes AbstractTestExt will not compile because testVar is not visible to AbstractTestExt.
 
      package test;
      public abstract class AbstractTest {
            String testVar;
      }

      package test.testExt;
      public class AbstractTestExt extends test.AbstractTest {

            public void test(){
                  System.out.println(this.testVar);
            }
      }


However changing the declaration of testVar to be protected:
        package test;
      public abstract class AbstractTest {
            protected String testVar;
      }
Will allow AbstractTestExt to see testVar.  To learn how these modifiers work visit:
http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial