problem with Java Web Start and Mouse and Key Events

Discussion in 'Java' started by evianhat, Apr 20, 2004.

  1. evianhat

    evianhat Guest

    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
     
    evianhat, Apr 20, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karl wettin
    Replies:
    2
    Views:
    528
    karl wettin
    Nov 3, 2004
  2. Replies:
    2
    Views:
    602
    Gernot Frisch
    Dec 15, 2005
  3. albert kao
    Replies:
    3
    Views:
    2,071
    Arne Vajhøj
    Feb 2, 2011
  4. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    406
    Chris
    Aug 30, 2005
  5. M P
    Replies:
    1
    Views:
    518
Loading...

Share This Page