aspose file tools*
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 Spring in Action this week in the Spring 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: 4642
    
    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: 4642
    
    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: 4642
    
    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