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.