BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-22-2008, 10:39 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2008
Model: 7100i
PIN: N/A
Carrier: nextel
Posts: 23
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Button click event

Please Login to Remove!

Hello,
i'm pretty new to programming in j2me and i wondering how do you set up a click event so taht when user clicks button certain things happen
Offline  
Old 07-22-2008, 10:52 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by eforr View Post
Hello,
i'm pretty new to programming in j2me and i wondering how do you set up a click event so taht when user clicks button certain things happen
HI,

R u working with J2ME or Blackberry API's ?
__________________
Jayaseelan.V
Mobile Application Developer
INDIA.
Offline  
Old 07-22-2008, 10:53 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2008
Model: 7100i
PIN: N/A
Carrier: nextel
Posts: 23
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Blackberry API's
Offline  
Old 07-22-2008, 10:58 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Use FieldChangeListener interface..

You can able to make event through button by using this..
__________________
Jayaseelan.V
Mobile Application Developer
INDIA.
Offline  
Old 07-22-2008, 10:59 AM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just do something like tis :

Code:
ButtonField button = new ButtonField("Valider")
            {
                protected boolean trackwheelClick(int status, int time)
                {
                    //Do what you want the button make
                    function() // for example
                    return true;
                }           
            };
And don't forget to add your button to the screen after
Offline  
Old 07-22-2008, 11:00 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Jul 2008
Model: 7100T
PIN: N/A
Carrier: Programmer
Posts: 50
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Create a new Class that extends "ButtonListener", then overwrite all the methods it ask you to.
Then on the main class, just button.setListener(Mathod)
I think, i might have messed up on the order or something, but the idea is basically that..
Offline  
Old 07-22-2008, 11:00 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Jul 2008
Model: 7100T
PIN: N/A
Carrier: Programmer
Posts: 50
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by goulamass View Post
Just do something like tis :

Code:
ButtonField button = new ButtonField("Valider")
            {
                protected boolean trackwheelClick(int status, int time)
                {
                    //Do what you want the button make
                    function() // for example
                    return true;
                }           
            };
And don't forget to add your button to the screen after
or that
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.