Are you sure your class is implementing the ItemListener interface?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Sep 22, 2004
i implemented the action listener in the class. I change qchk1Yes.addItemListener(this) to qchk1Yes.addActionListener but i still could get why they is error.
when we want to implement a Listener interface, we need to declare it somewhere so the compiler knows. That means either making our own listener class to handle all the methods in the listener interface ... OR, what would be best in this case, because ItemListener has only 1 method - itemStateChanged - we could simply state that we are implementing the ItemListener interface when declaring the class.
and don't forget to code your own itemStateChanged method in Class2 - if the compiler knows you want to use ItemListener, it will be looking for your implementation of this method.
hope that helps
[ October 19, 2004: Message edited by: J Chandler ]
[ October 19, 2004: Message edited by: J Chandler ] [ October 19, 2004: Message edited by: J Chandler ]