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 Applet focus problem, I think 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 "Applet focus problem, I think" Watch "Applet focus problem, I think" New topic
Author

Applet focus problem, I think

Clayton Cramer
Ranch Hand

Joined: Aug 26, 2010
Posts: 41
I have an applet that requests data from the user in a JTextArea, with two buttons: OK and Cancel. It works fine--except if I enter text in the JTextArea, then move to some other part of the page containing the applet. From then on, if I try to move back to the JTextArea in the applet, everything is frozen. The buttons do not respond; I can't enter anything in the JTextArea; I can't close the browser. All I can do is use Task Manager to kill the Java Console. Then I can close the browser.

My guess is that having lost focus, the applet does not know what to do when I move the mouse back into the part of the web page that contains the applet. As a debugging thing, I added "implements WindowListener" to the applet's definition, and put in methods to log the various window events, in the hopes that this might give me some clues. But it does not appear that any of these methods are being invoked. (Perhaps there is something equivalent to WindowListener for an Applet that I should be using?)

 
Don't get me started about those stupid light bulbs.
 
subject: Applet focus problem, I think
 
Similar Threads
container not appearing
determining minimum dimensions of an Applet
does a JTextArea need some event listener?
Acting as 'X'
Cursor handling in JTextArea