[java] Giving applets Focus first
Just a random question but just working on a simple pong game and when I load the applet within a html page, I firstly have to click on the applet to do anything on it. I know this isn't a major problem but just wondering if there is a way so when the page loads the applet is straight away under the player control?
Unsure if this would be better placed within the html forum but hopefully it should be ok here.
Thanks in advance.
Nate
I think there is some java script you can call to set the input focus on a page so that could be the place to start
:-)
:-)
irrc you can use the focus function of the DHTML applet tag in order to give focus to the applet though I am not sure if this will cause java to set the focus.
Example:
And the javascript for the page
I think that should help! Let me know if that works!
Example:
<applet id="myapplet_id" code="myapplet" archive="mypackage.jar" width=600 height=400 >Get java stupid!</applet>
And the javascript for the page
onload = document.all("myapplet_id").focus();
I think that should help! Let me know if that works!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement