Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Key Event Question.

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

When the user clicks on the middle button of there phone I want it to print something out to the screen. This may seem weird but this is just a test to see how it works. Since I am not actually sure how to monitor if that user has click that button or not. I was looking into key events but every example I seen seems to use the game canvus but I am not making a game.

So I am sure where to put my method. Right now I am just starring at a blank form and I would like to to display on this form.

private void keyPressed(int keyCode)
{
System.out.println("keyPressed " + ((char) keyCode));
}

Thanks
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to print on the form you can create textfield on the form and call textfield.setString("some string") and then display.setCurrent(form)
or something like that
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic