Reputation: 11
code-
new ItemListener() {
public void ItemStateChanged(ItemEvent event){
if(event.getStateChange()==ItemEvent.SELECTED)
pics.setIcon(pic[box.getSelectedIndex()]);
}
}
I am getting the error,
The new type ItemListener(){} must implement the inherited abstract class method ItemListener.ItemStateChanged(ItemEvent)
Upvotes: 0
Views: 502
Reputation: 311188
Assuming this is an anonymous implementation of java.awt.event.ItemListener
, it should implement the method itemStateChanged(ItemEvent e)
- note the lowercase i
in the API specification as opposed to the upper case I
in your implementation.
Upvotes: 3