Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Non static method in static context error?

807601Apr 23 2008 — edited Apr 23 2008
Hi, I have a section of code from my program which uses a method inherited from another class.

private void processLabyMenu( KeyEvent event ) {
int keycode = event.getKeyCode();
String x = new String();

if( Prax.Cfg.getString("returnToIntro").equalsIgnoreCa se
(KeyEvent.getKeyText(keycode)) )
{
mainWindow.setMapFile( null );
mainWindow.load();
}

and I get the error
"the non-static method getString(java.lang.String) cannot be referenced from a static context".

what can I put in that "if" statement for it to compile?

Thank you in advance...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2008
Added on Apr 23 2008
5 comments
459 views