Results 1 to 5 of 5
  1. #1
    gautham0209 is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default The function append() not working.

    For developing a calculator i need to use the 'append ()' to enter text into the textfield as shown in the tutorials.For example ,to add '1' to the textfield i need to write this code 'textfield.append("1")' which isn't workin in my case.....I've uploaded the screenshot here.......please help....why isn't it working?What should i do?The function append() not working.-java.jpg

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,572
    Rep Power
    25

    Default Re: The function append() not working.

    why isn't it working?
    Please explain what "not working" means?
    Are there compiler errors?

    Where is the variable text defined? What is it?
    Is the append() method defined for that class? Look in the API doc to see.

  3. #3
    gautham0209 is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Re: The function append() not working.

    Yes there are compiler errors..........you can see it in the picture which i've posted.The variable name of the textfield is 'text'.This is the error thrown "the method append(string) is undefined for the type JtextField".

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,572
    Rep Power
    25

    Default Re: The function append() not working.

    the method append(string) is undefined for the type JtextField
    The error message seems very clear.
    Did you read the API doc for JTextField to verify that the error message was correct?

  5. #5
    HTT90 is offline Member
    Join Date
    Nov 2011
    Posts
    5
    Rep Power
    0

    Default Re: The function append() not working.

    class JTextField don't have 'append' method , use JTextArea , instead .

Similar Threads

  1. validurl function not working when I click the submit button
    By kritijain in forum JavaServer Pages (JSP) and JSTL
    Replies: 7
    Last Post: 06-10-2011, 11:22 AM
  2. How to Append in file ?
    By Hippo in forum New To Java
    Replies: 2
    Last Post: 03-19-2010, 01:50 PM
  3. Replies: 3
    Last Post: 12-04-2009, 03:08 PM
  4. Static function to get current working directory
    By Java Tip in forum Java Tip
    Replies: 1
    Last Post: 06-23-2008, 02:13 AM
  5. JLabel append?
    By Jononomous in forum New To Java
    Replies: 0
    Last Post: 04-07-2008, 07:41 PM

Tags for this Thread

Posting Permissions

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