BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-11-2007, 09:49 AM   #1 (permalink)
New Member
 
Join Date: Aug 2007
Model: 8800
PIN: N/A
Carrier: Telcel
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Action in Button

Please Login to Remove!

Hi gang. I have a trouble building the action of any button. I created a button follow the instructions of our pal jonathanh fisher aka jfisher.

class ButtonOK extends ButtonField
{
ButtonOK( String label, int Width)
{
super( label);
width = Width;
}

public int getPreferredWidth()
{
return width;
}
}
.
.
.
.
ButtonOK button1 = new FixedWidthButtonField("OK", 80);
add(button1);



so, where I can build my function? what part of my ButtonOK class or any other part of teh code??

thansk a lot ...
__________________
..So, Iíve decided to take my work back underground
To stop it falling into the wrong hands ... Music for jilted generation
Offline  
Old 09-11-2007, 10:03 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to have a change listener for the button:

ButtonOK.setChangeListener(new FieldChangeListener(){
public void fieldChanged(Field field, int context){
//your action
}
});

Or you could build a class that implements FieldChangeListener and set a named instance to the button:

ButtonOK.setChangeListener(myChangeListener);
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!

Last edited by jfisher : 09-11-2007 at 10:06 AM. Reason: fixed stupid error
Offline  
Old 09-11-2007, 11:03 AM   #3 (permalink)
New Member
 
Join Date: Aug 2007
Model: 8800
PIN: N/A
Carrier: Telcel
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

it works !!! thanks jon, I followed the the next link

what's wrong with this button?

thanks for your help
__________________
..So, Iíve decided to take my work back underground
To stop it falling into the wrong hands ... Music for jilted generation
Offline  
Closed Thread


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

Server 92020 Double Dip Server, Cone Dip Warmer, SS, Countertop, 120 V
$100.0
Server 92020 Double Dip Server, Cone Dip Warmer, SS, Countertop, 120 V pictureServer Duct Tape Book
$18.0
Server Duct Tape Book  picture(A36) LANTRONIX MSS1-T MICRO SERIAL SERVER w/o adapter
$20.0
(A36) LANTRONIX MSS1-T MICRO SERIAL SERVER w/o adapter  pictureBlack and white polka dots waitress server waiter waist apron 3 pockets
$11.0
Black and white polka dots waitress server waiter waist apron 3 pockets pictureCNB INS2000 [3310-0077J] 1-CH Network Video Server BNC H.264 MPEG4 SD Card 128MB
$19.99
CNB INS2000 [3310-0077J] 1-CH Network Video Server BNC H.264 MPEG4 SD Card 128MB picture






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