Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-26-2009, 05:10 AM
Member
 
Join Date: Mar 2009
Posts: 4
Rep Power: 0
bsebal28 is on a distinguished road
Default storing information
I have one class that creates an "application" GUI and one of my other classes is full of getters and setters to help save the information that is typed by the user in the JTextFields. However, when i try to call the setters from the application class, i get the "Cannot make a static reference to the non-static method" error. Any suggestions on where to go from here?
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 03-26-2009, 05:34 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,523
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Seems you are accessing non-static member on static contest, according to your error message. You cannot do that.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-26-2009, 08:07 AM
Member
 
Join Date: Feb 2009
Posts: 22
Rep Power: 0
faisalcmpm is on a distinguished road
Default
Can u paste ur line of code Here.
Seems like you are calling the setter method without instantiating the 'SetterClass'
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 03-26-2009, 09:10 AM
Member
 
Join Date: Mar 2009
Posts: 42
Rep Power: 0
trax is on a distinguished road
Smile
U might be Accessing non-static member variables from static methods .Post the code 4 more help
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing the data in a file vasavi.singh New To Java 4 02-20-2009 05:01 PM
Help in storing Information care New To Java 1 12-01-2008 10:16 PM
storing and retrieving a file as such anil_manu Advanced Java 0 03-11-2008 02:27 PM
Storing data permanently shaungoater New To Java 2 03-10-2008 05:18 PM
Storing Data Khorod New To Java 1 08-03-2007 06:48 AM


All times are GMT +2. The time now is 05:57 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org