Results 1 to 4 of 4
  1. #1
    bsebal28 is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    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?

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Seems you are accessing non-static member on static contest, according to your error message. You cannot do that.

  3. #3
    faisalcmpm is offline Member
    Join Date
    Feb 2009
    Posts
    22
    Rep Power
    0

    Default

    Can u paste ur line of code Here.
    Seems like you are calling the setter method without instantiating the 'SetterClass'

  4. #4
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Smile

    U might be Accessing non-static member variables from static methods .Post the code 4 more help

Similar Threads

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •