×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    214

    Unhappy Calculator doubt in lwuit

    hi please do on ur own
    Last edited by kumarv75; 2010-06-28 at 11:19.

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Calculator doubt in lwuit

    Code:
    if(operation.equals("+"))
    {
    float result = Float.parseFloat(valueone) + Float.parseFloat(valuetwo);
    resetCalculator();
    valueone=result;
    secondValueStarted=true;
    text.setText(String.valueOf(result));
    }
    This way - valueone becomes result and if you noe press + again it will treat the text box as 2nd value and keep on adding.
    Thanks,
    Ekta

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    214

    Re: Calculator doubt in lwuit

    but I have taken the value one as string so how will it come.........................

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Calculator doubt in lwuit

    Try
    Code:
    if(operation.equals("+"))
    {
    float result = Float.parseFloat(valueone) + Float.parseFloat(valuetwo);
    resetCalculator();
    valueone=""+result; // make it a string
    secondValueStarted=true;
    text.setText(String.valueOf(result));
    }
    Thanks,
    Ekta

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    214

    Re: Calculator doubt in lwuit

    Quote Originally Posted by ektasrv View Post
    Try
    Code:
    if(operation.equals("+"))
    {
    float result = Float.parseFloat(valueone) + Float.parseFloat(valuetwo);
    resetCalculator();
    valueone=""+result; // make it a string
    secondValueStarted=true;
    text.setText(String.valueOf(result));
    }
    Thank u Ekta if u could help me more can u please give me the full code like I have posted for the calculator as have some problems ................................please help me .........................................

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Calculator doubt in lwuit

    Quote Originally Posted by kumarv75 View Post
    Thank u Ekta if u could help me more can u please give me the full code like I have posted for the calculator as have some problems ................................please help me .........................................
    Please elaborate your problem area's in the code and I will try to help you out.
    Thanks,
    Ekta

  7. #7
    Registered User
    Join Date
    May 2010
    Posts
    214

    Re: Calculator doubt in lwuit

    Quote Originally Posted by ektasrv View Post
    Please elaborate your problem area's in the code and I will try to help you out.

    What happend was by mistake the folder got deleted where I had saved in the code .............................................This code was given by discussing with my frnd I am new to lwuit he explained me about the code .............................now when I again copy the code n run in netbeans it does work instead shows lot of errors so if don't mind can u please help me in this ...............................................I would be very gr8 full to u if u help me in this problem ..............................................................can u please copy the codes run and just remove the errors and post it back so that it would be easy for me please..........................I pledge u please help me

  8. #8
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Calculator doubt in lwuit

    Quote Originally Posted by kumarv75 View Post
    What happend was by mistake the folder got deleted where I had saved in the code .............................................This code was given by discussing with my frnd I am new to lwuit he explained me about the code .............................now when I again copy the code n run in netbeans it does work instead shows lot of errors so if don't mind can u please help me in this ...............................................I would be very gr8 full to u if u help me in this problem ..............................................................can u please copy the codes run and just remove the errors and post it back so that it would be easy for me please..........................I pledge u please help me
    Sorry as I am on the move these days and dont have any IDE's setup on my this new HP netbook... cant help you now that much with the code, but if you have any specific issue or you are stuck after cleaning up of your complilation errors I may help you with those specific issues.
    Thanks,
    Ekta

  9. #9
    Registered User
    Join Date
    May 2010
    Posts
    214

    Re: Calculator doubt in lwuit

    Quote Originally Posted by ektasrv View Post
    Sorry as I am on the move these days and dont have any IDE's setup on my this new HP netbook... cant help you now that much with the code, but if you have any specific issue or you are stuck after cleaning up of your complilation errors I may help you with those specific issues.
    k can u tell me how to add lot of buttons in a form I known its by doing the addComponent but in my program I have declared a string array and done it can u tell me that plz.......................

Similar Threads

  1. doubt in lwuit
    By kumarv75 in forum Mobile Java General
    Replies: 6
    Last Post: 2010-06-09, 05:06
  2. doubt in lwuit
    By kumarv75 in forum Mobile Java General
    Replies: 5
    Last Post: 2010-06-08, 11:07
  3. Need help with calculator
    By rocka1 in forum Symbian
    Replies: 1
    Last Post: 2009-03-13, 19:41
  4. Calculator
    By vnsbudhe in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2006-03-31, 20:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×