return to tranceaddict TranceAddict Forums Archive > Main Forums > Chill Out Room

 
implements ActionListener & ItemListener?
View this Thread in Original format
Turbonium
For a Java applet...

What's the syntax to implement both? The following obviously does not work, but it's just to give you an idea of what I'm talking about...

code:
import java.applet.*; import java.awt.*; import java.awt.event.*; public class proggyName extends Applet implements ItemListener implements ActionListener { }
3xx3r7
Aren't you supposed to implement only one thing? Since implements is associated with usage of methods specified in the interface that is implemented.

Looks like you're trying to code GUI.
Turbonium
The stupid assignment required the use of both checkboxes and buttons, in an applet. So I dunno how else to listen for both checkbox entries, as well as button clicks.

This is by far the most useless Java book ever. I can't believe my school is using this crap. I swear, if you look at this thing, you will laugh.
DigiNut
code:
implements ItemListener, ActionListener
mezzir
quote:
Originally posted by DigiNut
code:
implements ItemListener, ActionListener

beat me to it :p
starglider
Ah... glad I don't have to do that anymore.
3xx3r7
I am just learning Java. Finished an intro course this semester.
digitally404
Yea, diginut gave the right answer... I liked java, and i was having the exact same problem trying to figure out how to implement more than one thing in a program, once i got that figured, the rpg game fell through quite nicely :D
CLICK TO RETURN TO TOP OF PAGE
 
Privacy Statement