BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links



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

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
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
Jayaseelan Offline
Thumbs Must Hurt
 
Posts: 50
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Default 07-22-2008, 10:52 AM

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
Chennai - INDIA.
   
Reply With Quote
  (#3 (permalink)) Old
eforr Offline
Knows Where the Search Button Is
 
Posts: 23
Join Date: May 2008
Model: 7100i
PIN: N/A
Carrier: nextel
Default 07-22-2008, 10:53 AM

Blackberry API's
   
Reply With Quote
  (#4 (permalink)) Old
Jayaseelan Offline
Thumbs Must Hurt
 
Posts: 50
Join Date: Jun 2008
Location: Chennai
Model: 8130
PIN: N/A
Carrier: AIRTEL
Default 07-22-2008, 10:58 AM

Hi,

Use FieldChangeListener interface..

You can able to make event through button by using this..


Jayaseelan.V
Mobile Application Developer
Chennai - INDIA.
   
Reply With Quote
  (#5 (permalink)) Old
goulamass Offline
Talking BlackBerry Encyclopedia
 
Posts: 204
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Default 07-22-2008, 10:59 AM

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
   
Reply With Quote
  (#6 (permalink)) Old
Aiwa Offline
Thumbs Must Hurt
 
Posts: 50
Join Date: Jul 2008
Model: 7100T
PIN: N/A
Carrier: Programmer
Default 07-22-2008, 11:00 AM

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..
   
Reply With Quote
  (#7 (permalink)) Old
Aiwa Offline
Thumbs Must Hurt
 
Posts: 50
Join Date: Jul 2008
Model: 7100T
PIN: N/A
Carrier: Programmer
Default 07-22-2008, 11:00 AM

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
   
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1