Connecting Tech Pros Worldwide Help | Site Map

react to 1-9 button click in java mobile app

Member
 
Join Date: Aug 2007
Posts: 89
#1: Dec 14 '07
hi all,

i'm building my first java application for symbian os, and need to write custom logic to react to buttons 1-9 being pressed. how do i do that? where do i add the routines etc?

i'm using netbeans 6.0 with the mobility pack, so if there's a visual "shortcut" i'll gladly use it ;)

thanks!
-tomas
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Dec 18 '07

re: react to 1-9 button click in java mobile app


Quote:

Originally Posted by BlackMustard

hi all,

i'm building my first java application for symbian os, and need to write custom logic to react to buttons 1-9 being pressed. how do i do that? where do i add the routines etc?

i'm using netbeans 6.0 with the mobility pack, so if there's a visual "shortcut" i'll gladly use it ;)

thanks!
-tomas


Just query the keyCode in the keyPressed or keyReleased method to find out which button was clicked.
Have a look at this page for some details.
Member
 
Join Date: Aug 2007
Posts: 89
#3: Dec 20 '07

re: react to 1-9 button click in java mobile app


Quote:

Originally Posted by r035198x

Just query the keyCode in the keyPressed or keyReleased method to find out which button was clicked.
Have a look at this page for some details.

thanks for your reply! unfortunately it didn't get me all the way... i'm extremely new to java, and so far i've done everything in some sort of "design view" in netbeans 6. i took a look at the page and understood some of it, but when i tried to insert the
Expand|Select|Wrap|Line Numbers
  1. protected void keyPressed(int keyCode){}
method i just got errors everywhere...

do you know any way to insert this method in the right place through some menu or "toolbox" in the netbeans ide?
Reply