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  




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