E
evianhat
Hi -
I've created a java game app that changes the users video mode to
full-screen 640X480 and then takes keyboard and mouse input from the
user while they play. All of my resources are wrapped up in a jar
file and accessing those resources works fine. Also, the video mode
successfully changes to 640X480 and then back when they are done.
What doesn't work is this: keyboard or mouse events. I've run the app
from my development machine with the command-line 'java -jar
MyGame.jar' and everything (including mouse and key events) works
fine. But when I put the app on my server and download it via Java
Web Start, none of the input works. I have put debug lines in my code
for keyPressed( ), keyReleased( ) and mousePressed( ) like the one
below. When I run it from the command-line, I get nice output lines
saying "keyPressed( ): A', etc. But, again, from Java Web Start,
there is no output in my output log file (yes, the log file is
enabled...I can see other output lines, just not the key and mouse
events).
// from the KeyListener interface
public void keyPressed(KeyEvent e) {
System.out.println( "keyPressed( ): " + e.getKeyChar( ) );
...
}
Here's a stripped-down version of my jnlp file:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://www.foo.com/bar"
href="MyGame.jnlp">
<information>
<offline-allowed/>
</information>
<security>
<!-- get all permissions -->
<all-permissions/>
</security>
<resources>
<j2se version="1.4+" initial-heap-size="64m"/>
<jar href="MyGame.jar"/>
</resources>
<application-desc main-class="com.foo.bar.MyGame.Game"/>
</jnlp>
As you can see, the app asks for all permissions. When I run the app
from Java Web Start, it warns me about the permissions, and I click
"Yes" to run the app anyway. So, as a programmer, I'm assuming that I
have access to all of the client machine, including the mouse and
keyboard events. But I'm not getting them.
Can anyone tell me what I'm doing wrong? I'm guessing that there are
people out there who are deplying java apps via Web Start, and that
those apps take mouse and keyboard input from the user . So my only
thought is that I'm not setting something up right.
Please help!
- Thomas
I've created a java game app that changes the users video mode to
full-screen 640X480 and then takes keyboard and mouse input from the
user while they play. All of my resources are wrapped up in a jar
file and accessing those resources works fine. Also, the video mode
successfully changes to 640X480 and then back when they are done.
What doesn't work is this: keyboard or mouse events. I've run the app
from my development machine with the command-line 'java -jar
MyGame.jar' and everything (including mouse and key events) works
fine. But when I put the app on my server and download it via Java
Web Start, none of the input works. I have put debug lines in my code
for keyPressed( ), keyReleased( ) and mousePressed( ) like the one
below. When I run it from the command-line, I get nice output lines
saying "keyPressed( ): A', etc. But, again, from Java Web Start,
there is no output in my output log file (yes, the log file is
enabled...I can see other output lines, just not the key and mouse
events).
// from the KeyListener interface
public void keyPressed(KeyEvent e) {
System.out.println( "keyPressed( ): " + e.getKeyChar( ) );
...
}
Here's a stripped-down version of my jnlp file:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://www.foo.com/bar"
href="MyGame.jnlp">
<information>
<offline-allowed/>
</information>
<security>
<!-- get all permissions -->
<all-permissions/>
</security>
<resources>
<j2se version="1.4+" initial-heap-size="64m"/>
<jar href="MyGame.jar"/>
</resources>
<application-desc main-class="com.foo.bar.MyGame.Game"/>
</jnlp>
As you can see, the app asks for all permissions. When I run the app
from Java Web Start, it warns me about the permissions, and I click
"Yes" to run the app anyway. So, as a programmer, I'm assuming that I
have access to all of the client machine, including the mouse and
keyboard events. But I'm not getting them.
Can anyone tell me what I'm doing wrong? I'm guessing that there are
people out there who are deplying java apps via Web Start, and that
those apps take mouse and keyboard input from the user . So my only
thought is that I'm not setting something up right.
Please help!
- Thomas