• Post Reply Bookmark Topic Watch Topic
  • New Topic

ItemListener,Swing, and Class Error.  RSS feed

 
Zeke Hans
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


framed class must implement inherited abstract class ItemListener.itemStateChange(ItemEvent); . What did I do wrong? I got the idea from here: the Guidebook. Any ideas? Thanks. (The only problem was with framed)
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Zeus Macabre", please read your purple mooseages for an administrative matter.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say,
ItemListener has the method definition itemStateChanged(ItemEvent e)
On the other hand,
ActionListener has the method definition actionPerformed(ActionEvent e)

So whatever listener you are implementing, you should provide the proper implementation of the correct method
The book URL you posted, does it correctly.
Swing has different type of events. You need to listen to the correct type of event, depending on what your code does. Recommended reading http://docs.oracle.com/javase/tutorial/uiswing/events/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!