View Single Post
  #5 (permalink)  
Old 04-24-2008, 10:51 AM
Zosden's Avatar
Zosden Zosden is offline
Senior Member
 
Join Date: Apr 2008
Posts: 386
Zosden is on a distinguished road
Quote:
Originally Posted by danielstoner View Post
The message is clear: you are calling a a non static method (Prax.Cfg.getString) from a static context. It seems Prax.Cfg is a inner class and you should use an instance of that class in the if condition.
But that being said, a bigger chunk of the code will help with understanding.
This is correct you need to create an instance of the class your trying to access. For example

Code:
public class Demo { Prax myPrax; public Demo() { myPrax = new Prax(); myPrax.Cfg.getString(); } }
Think of it this way the:

The way your doing it is calling the actual class. That could have multiple instances of it running in your system. This is fine if your class is static meaning it doesn't change when you create multiple instances of it.

What you want to do is edit a new instance of it.

When you work on your car in real life, are you working on the model car that the manufacture made or are you working on your "instance" of that car.

Last edited by Zosden : 04-24-2008 at 10:55 AM.
Reply With Quote