|
-
February 25th, 2011, 05:05 AM
#2
Re: adding listeners to java applets
If you want help with a Java error, please post the full text of the error message and stack trace if present.
You're trying to add the applet as an ItemListener and an ActionListener, but although it has actioPerformed and itemStateChanged methods, it doesn't implement those interfaces.
Incidentally, I strongly recommend that you follow the Java Coding Conventions - particularly the naming conventions - class names start with an uppercase letter, method and variable names start with a lowercase letter. Java names follow 'camelHump' format where the first letter in each following word in the name is capitalised, e.g. Applet3, myContentName, totalPrice, etc.
These aren't rules - the compiler won't complain if you don't follow them, but they are pretty much universal among Java developers. If you want people to help with your code, or if you're thinking of working in a team at some point, it's advisable to follow the conventions.
Act in haste and repent at leisure; code too soon and debug forever...
R. Kennington
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|