Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Help needed for java code

    basically what i was trying to do is write a code to clear text variables

    string s;
    s=txtNumber1.setText("");
    s=txtNumber2.setText("");
    s=txtAnswer.setText("");
    txtAnswer.setText(s); error i get says incompatible

    what its meant to do is clear variables that you input
    lets say addition of two numbers
    ...................................................
    i.e string s;
    ceil no1;
    ceil no2;
    s=txtn1.getText();
    no1=Ceil.parseCeil(s) etc
    Last edited by Inquisit; 08-29-2008 at 10:21 AM. Reason: mistake typed

  • #2
    Regular Coder Aradon's Avatar
    Join Date
    Jun 2005
    Location
    USA
    Posts
    734
    Thanks
    0
    Thanked 20 Times in 19 Posts
    What is the type of txtNumber1? Or the other txtNumbers? Are they JLabels?

    Without knowing what types they are I'm not sure how to answer your question.

    Also, what is Ceil?

    If you could post your full working source code, that would help.
    "To iterate is human, to recurse divine." -L. Peter Deutsch


  •  

    Posting Permissions

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