RSS Forums RSS
Please support our Java advertiser: Lunarpages Java Web Hosting

First JLIST, used with GUI Inventory

Join Date: Jul 2007
Location: Virginia
Posts: 102
Reputation: TheGathering is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
TheGathering's Avatar
TheGathering TheGathering is offline Offline
Junior Poster

Re: First JLIST, used with GUI Inventory

  #5  
Jul 25th, 2007
It tells me getValue cannot be referenced from a static context. I am not sure what that means.

To answer your question about the static context error, you're trying to access CdwArtist's method .getValue() without ever making a CdwArtist object or declaring the getValue method as static (not recommended).

Try creating a new CdwArtist object and calling the getValue() method from it after it has been populated with data.

I then tried just to do the calculation manually and replaced it with ("$" + (nstock * price));, but it tells me those symbols are not found

Again, that's because nstock and price are inside of CdwArtist (Compactdisk) but you do not have a CdwArtist you are getting the value from. Create a new CdwArtist with it's values set and call the variables from the said object.



Remember, the computer only does what you tell it to. If you tell it to use something like a method or variable from another class without telling it it's in the other class, the computer doesn't know to go looking for it, it only knows that it doesn't have what it needs (hence the error).
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:48 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC