File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Applet Code Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Applet Code Error" Watch "Applet Code Error" New topic

Applet Code Error

Linda Weeks

Joined: Dec 02, 2001
Posts: 3
When I try to run DonnaApplet, the appletviewer screen comes up and I'm able to feed in the name and numbers but when I click Submit Scores I get this error message:
A:\>appletviewer DonnaApplet.html
Exception occurred during event dispatching:
at java.lang.Integer.parseInt(Compiled Code)
at java.lang.Integer.parseInt(
at DonnaApplet.actionPerformed(
at java.awt.AWTEventMulticaster.actionPerformed(
at java.awt.Button.processActionEvent(
at java.awt.Button.processEvent(
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventQueue.dispatchEvent(Compiled Code)
Here's my code:


[This message has been edited by Cindy Glass (edited December 03, 2001).]
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
In your init() method you do this line twice:
The second one should be
You still need to put error checking in for the rank textfield in case a non number is entered in or nothing at all.
What is currently happening is the action listers actionPerformed() is being fired twice for every click. The second time in the textfield contains nothing so you get the exception. Which is why you need to put in error checking.
I agree. Here's the link:
subject: Applet Code Error
jQuery in Action, 3rd edition