The only way I know to do that is like this:
priceField.addActionListener(new ActionListener()
{
final void actionPerformed(ActionEvent evt)
{
valueField.setValue("$"+new Float(currentCD.getValue()));
}
});
I am pretty sure this declares the action event as final, which is not right, but as I know no other way I do it, and then get.
Inventory2.java:187: actionPerformed(java.awt.event.ActionEvent) in cannot implement actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener; attempting to assign weaker access privileges; was public
final void actionPerformed(ActionEvent evt)
^
Inventory2.java:189: local variable currentCD is accessed from within inner class; needs to be declared final
valueField.setValue("$"+new Float(currentCD.getValue())); I never drew first, but I drew first blood.
I'm no ones son, unforgiven.