This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes event action in applet not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "event action in applet not working" Watch "event action in applet not working" New topic
Author

event action in applet not working

Jorge Vazquez
Greenhorn

Joined: Nov 04, 2012
Posts: 7
Hi everyone!...
I got this applet, that converts from decimal to binary to hex and vice versa, but the even listeners are not doing anything... when I enter a number and press enter. nothing happens. Also, the applet crashes when trying to close it. Any help appreciated

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Hello Jorge, and welcome to the Ranch! Which listener did you expect to respond to the <Enter> key?

Also, the applet crashes when trying to close it.

An Applet is meant to be displayed in a browser. What exactly do you mean by 'closing' an Applet?


luck, db
There are no new questions, but there may be new answers.
Jorge Vazquez
Greenhorn

Joined: Nov 04, 2012
Posts: 7
Darryl Burke wrote:Hello Jorge, and welcome to the Ranch! Which listener did you expect to respond to the <Enter> key?

this method:


An Applet is meant to be displayed in a browser. What exactly do you mean by 'closing' an Applet?

yeah, but I can also run it in netbeans...
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

So now, the first thing you should do is put a System.out.println("in actionPerformed") at the top of the actionPerformed(...) method to confirm that the method is entered. Do that and report the result here.
Jorge Vazquez
Greenhorn

Joined: Nov 04, 2012
Posts: 7
Darryl Burke wrote:So now, the first thing you should do is put a System.out.println("in actionPerformed") at the top of the actionPerformed(...) method to confirm that the method is entered. Do that and report the result here.

yeah, I found the problems... one: I declare three variables outside of the class (After I changed my code I forgot to remove them). Second: on line 90 instead of using decNumber I'm using decimalNumber, so I corrected that and seem to work now. Thanks.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

I'm happy you solved your problem yourself, fut I'm flummoxed how you could do this, as Java doesn't allow anything of the sort:
Jorge Vazquez wrote:I declare three variables outside of the class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: event action in applet not working
 
Similar Threads
Referencing swing components from ActionEvent
JSplitterView treats panes differently
Puzzle Solver
change text on jtextfield from one class after clicking submit from another class
Help designing a GUI