Results 1 to 2 of 2
  1. #1
    erik6048 is offline Member
    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    0

    Default get keypresses from SVGForm with only SVGLabels

    I have a Screen class, extending SVGFORM, with only labels in it.No buttons or spinners and the like.
    The SVGForm is displayed and on clock ticks, I change the label strings (telling time). So no input facilities.
    The SVGForm has commands, Exit and pause.
    The SVGForm is on its own thread, being Runnable.
    all works nicely, but:

    I need to act on the user pressing the "FIRE" button of the handset.
    How can I get at the key code ?
    keyPressed() does not catch it, somehow...

    one more:
    I put the SVGForm on its own thread. The program starts with a splash screen, then an input form to get some variables and then the clock screen starts and keeps running, that being the sole purpose of the program. When the clock is stopped , the program may exit. Is a separate thread for it necessary/a good idea ? or shouldn't I be bothered with threads at all ?

  2. #2
    erik6048 is offline Member
    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    0

    Default

    found out myself: I have to implement an SVGEventListener for the class and then the keyPressed() member catches the key.

Similar Threads

  1. Help - Swing Timers, Two Keypresses
    By Gheta in forum AWT / Swing
    Replies: 2
    Last Post: 07-29-2009, 09:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •