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

First JLIST, used with GUI Inventory

Join Date: Jul 2007
Posts: 186
Reputation: no1zson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
no1zson's Avatar
no1zson no1zson is offline Offline
Junior Poster

Re: First JLIST, used with GUI Inventory

  #2  
Jul 25th, 2007
I tried to add this listener in an attempt to have my Value field calculated upon leaving the Price field.
	// listener to perform calc upon leaving the price field
		priceField.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent evt)
			{
				valueField.setValue("$"+new Float(CdwArtist.getValue()));
			}
		})

It tells me getValue cannot be referenced from a static context. I am not sure what that means.
I then tried just to do the calculation manually and replaced it with ("$" + (nstock * price));, but it tells me those symbols are not found.

Obviously I am not coding this right, but it is the logic that I am having the most trouble with.
I do not understand why I have to do this step (even when I get it right) if I can get the field defintion problem worked out.
When I define a field as "getValue", and value returns (nstock * price), as defined in my CdwArist class, then why do I have to create a listener in the first place?
Am I making any sence?
Last edited by no1zson : Jul 25th, 2007 at 2:24 pm.
I never drew first, but I drew first blood.
I'm no ones son, unforgiven.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:12 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