Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Regular Contributor
Posts: 56
Registered: ‎09-14-2011
My Device: 9000
My Carrier: b.tech
Accepted Solution

Update sample x value

Hi

i am new in blackberry , i want to know how to update value of any integer (example).Please give me sample 

 

code running code so i can applied gud logic.Example

 

I want to update value of x:

 

Please Help 

Developer
Posts: 16,998
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Update sample x value

you don't, you create a new Integer.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 56
Registered: ‎09-14-2011
My Device: 9000
My Carrier: b.tech

Re: Update sample x value

Hi

i can't understand..Please sir help with small code..
Regular Contributor
Posts: 56
Registered: ‎09-14-2011
My Device: 9000
My Carrier: b.tech

Re: Update sample x value

actually i want to update from the server .
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Update sample x value

Hi Naveen,

 

I dont know about your requirement, but see this snippet to update the value.

 

public class MyScreen extends MainScreen
{
    private int i = 0;
    private LabelField lblNum;
    
    public MyScreen()
    {
        lblNum = new LabelField(""+i);
        
        ButtonField _btn = new ButtonField("Click Here",ButtonField.CONSUME_CLICK);
        _btn.setChangeListener(new FieldChangeListener() {
            
            public void fieldChanged(Field field, int context) {
                i = i+1;
                lblNum.setText(""+i);
                invalidate();
                
            }
        });
        
        add(lblNum);
        add(_btn);
    }
}

 

Thanks.

Regular Contributor
Posts: 56
Registered: ‎09-14-2011
My Device: 9000
My Carrier: b.tech

Re: Update sample x value

Thanks but i want this value update from server : x can take any value which server not (continuously increasing or decreasing )
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Update sample x value

How you are getting value from server,

Have you established any connection?

 

Regular Contributor
Posts: 56
Registered: ‎09-14-2011
My Device: 9000
My Carrier: b.tech

Re: Update sample x value

Actually i am new in blackberry but,some one ask me this question how to update value from server. i think connection is required ,after that we will take response of server
so i am searching for code.i don't have any url but i am searching for sample code in which update in occurring
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Update sample x value

Please only ask a question once.  There is no value in having duplicate entries and it bloats the forum,

 

Shall I ask the administrators to remove this duplicate Thread?

http://supportforums.blackberry.com/t5/Java-Development/Update-value-from-the-server/td-p/1778225

Regular Contributor
Posts: 56
Registered: ‎09-14-2011
My Device: 9000
My Carrier: b.tech

Re: Update sample x value

Yes sir i got it answer thanks