Delete a character at a time from a textarea

I am designing a mobile phone simulation, where the user creates a message from a keypad, to the text area, there is a back button that does two things:
1. Deletes a character at a time
2. Moves back through text
How do i delete a character at a time //
I thought about doing a count of the text in the text area then use delteCharAt() and give the position as count, but it requires the variable to be a StringBuffer and mytextarea variable is of type string, this is what i have done but it does not work any suggestions please.
int count = 0;
System.out.println("pressed BCK");
txtmsg = (display.getText());
count = txtmsg.length();
System.out.println(count);
          if (e.getSource()==keys[9])
               System.out.println("pressed BCK twice - DELETE");
               txtmsg.deleteCharAt(count);
               display.setText(display.getText());
          }Thank You

When i do this i get the following error, cannot find symbol method deleteCharAt().
Txtmsg is of type string, don't know if this matters.

Similar Messages

  • Deleting a character at a time from a textarea

    I am designing a mobile phone simulation, where the user creates a message from a keypad, to the text area, there is a back button that does two things:
    1. Deletes a character at a time
    2. Moves back through text
    How do i delete a character at a time //
    I thought about doing a count of the text in the text area then use delteCharAt() and give the position as count - 1 and the value as "" would this work
    Thank you

    I ran into this situation before. Try this for the backspace:
    textBox.setText(textBox.getText().substring(0,textBox.getText().length()));
    ...Woah... I think that works, it just looks kinda complicated. For textBox, replace it with the name of your JTextField
    As for the going back through text, use an arraylist (or vector or whatever your choice for a collection) and when they click like a "back button" then it would do a textBox.setText(collection.get(current - 1);
    (JTextField textBox, Collection collection, int current)
    Hope this helps!

  • How do i delete  multiple emails at one time from iphone Mail account with iphone 4s?

    how do i delete  multiple emails at one time from iphone Mail account with iphone 4s?

    Better than that!
    http://www.youtube.com/watch?v=fKa-KFjUIGE
    Select a message, hold the move button, deselect the message while still holding the move button.
    A new window appears allowing you to move all messages to the trash.
    Bingo!

  • **HOW DO I DELETE ONE CALL AT A TIME FROM MY IPHONE 4???**

    Please help I can't delete one call at a time from my call log!!

    Lol! I'm not cheating on anyone, never have... I just delete multiples of calls so my phone doesn't get too filled up.. But I'm also guessing now that I have an iPhone and not an htc I won't have a space issue. Thanks very much!!

  • How do I delete  one item at a time from trash?

    How does one delete one item at a time from trash?

    In general, one doesn't.
    I suggest you create a new folder (I use "Trash Soon") on the desktop near the trash icon. Move all the stuff out of the Trash bin into the Trash Soon Folder. Then move the things you really want to eliminate to the Trash can. Empty Trash.
    DO NOT store anything you want to keep in the real Trash can. There are many activities that may cause "Empty Trash" a a side-effect.
    If you have multiple drives, The Trash is an illusion created for your convenience. The actual Items may be on several different drives, but all marked as "in Trash". Moving them to a folder on a different drive may cause unexpected copying.

  • Can only delete one URL at a time from History, why not more?

    In prior versions you could select a rabge and delete them all at one time.

    When you open the History sidebar (Ctrl-H), you can only right-click an entry, Delete This Page, but if you open the History Library (Ctrl-Shift-H), multiple entries can be selected as above and then press the Delete key.

  • Can I delete multiple songs at one time from my iPad mini

    Is there a way to delete multiple songs at one time without doing a hard reset?

    Here are two ways I would try:
    You can hold down your shift key while selecting playlists. This allows you to select multiple items. However, it does not allow you to skip over a playlist. All contiguous lists will be selected using this method. Once you have all the playlists selected, right click on the selection and choose delete.
    If method one won't work because you want to pick and choose lists to delete, I'd make a folder and pull all of the lists I don't want into this folder. Then you can delete the whole folder. Once you have all of the playlists you no longer want in the folder, just right click on the folder and choose delete.

  • How do I delete    all contacts (at one time) from i      phone4

    Somehow I have gotten mutilple listing in contacts.  How do I delete all contacts from I phone and start over?

        baprawski,
    Is there a particular reason why you want to delete the contacts all at once? The only way you can delete all the contacts all one time would be to wipe the device. This will complete erase all data on the phone including the contacts.
    You want to make sure you backup your device uisng the desktop manager. Once you perform the wipe you can then backup your contacts using the desktop manager and just make sure to uncheck the Contacts when backing up so they are not added back to your phone.
    John B
    Follow us on Twitter @VZWSupport

  • Add one character at  a time from External Text file

    Hi,
    I'm using Flash 8, and I have created a standard Dynamic
    field that pulls the text from an external text file using the
    LoadVars function and it works fine.
    To get the correct effect for the design, I would like to be
    able to create the illusion that the characters are being typed out
    when the page loads as if someone has started typing and also hear
    the "Typewriter Clack" each time a character appears.
    The only place I have found an example is on the Syphon
    Filter Game website which seems to have created the illusion
    perfectly:
    http://www.syphonfilterdarkmirror-thegame.com/en_IE/
    (Check out the bottom right section)
    I could create a Movieclip and add a character each frame
    but, I would like to be able to edit the text when required via a
    text file or even ASP or PHP if neccessary.
    Any help would be grateful.
    Cheers

    or here:
    http://www.actionscripts.org/tutorials/beginner/Scripted_Typerwriter/index.shtml

  • Can I delete E-mails from my GMAIL account on my Verizon Phone without deleting them at the samem time from my computer?

    I use GMAIL for e-mailing.  Can I delete gmail messages from my Verizon Phone WITHOUT having them deleted from my computer at the same time?

    you can do it, but how to do it depends on how you have email set up on your pc and on your phone, and what type of phone you have. for example, i use outlook on my pc for all of my email accounts. i have it set in the options to leave a copy of the email on the server when i delete an email. i also have an option on my phone the is NOT checked, that says "delete mail on server." this way, i can delete emails from the pc or the phone, and they stay on the server and the other device. to delete them from both, i have to actually delete them myself from both, the pc and my phone. different email clients and different phones are set up a bit differently, but they should all have some variations of a setting to leave a copy on the server after deleting it on the respective device.
    edit: one other box i left unchecked on my phone is "sync deleted item from server" (this also removes messages from the phone when deleted from the server, the next time it syncs).

  • How do i delete multiple photos at one time from the cameral roll on iPhone?

    I need space on my iPhone4s, and have thousands of photos on the camera roll, which are backed up on my computer, so want to delete them. MUST I delete by choosing them individually and deleting, or is there a way to mass delete them?

    I just had the same problem.  I had 8.6 GB of photos on my camera roll, and my new iPhone only had 16 GB. The error message telling me that I had run out of space kept coming up, and I couldn't take any more pictures. So I followed wjosten's suggestions.
    wjosten wrote:
    Launch Image Capture from your applications folder, connect your phone...does Image Capture see the photos? If so, you can use Image Capture to delete them.
    It really only helped to have a mac, and image capture ran perfectly.
    *When you open Image Capture, all I had to do was click on the red warning/danger sign to delete the selected photos.  I have my phone streaming with my Mac, so I didn't discriminate between all my old photos had already been backed up.

  • How can I delete multiple files at a time from "Finder"

    I can't possible delete the thousands of junk files that showed up in Finder once I downloaded Maverick.  I can't delete more than one at a time now.  Why won't the highlighting stay in place on more than one file that I want to delete?

    How are you trying to select multiple files?
    What makes you think that "thousands of junk files [...] showed up in Finder once I downloaded Maverick" (or even installed it)?

  • Read a character 1 at a time from a text file

    Hi all,
    I have tried the following to read 1 character at a time from a text file but it did not work;
    int buf_sz = 1;
             try
                BufferedReader br = new BufferedReader( new FileReader( "C:\\bitshift.txt", buf_sz ));
                String rd_line = null;
                while( (rd_line = br.readLine()) != null)
                    System.out.println(rd_line + "\n");
             }I could only get it to read the whole line by removing the buf_sz when creating an instance of the BufferedReader.
    How can I achieve this?
    Thanks

    The Javadoc for Reader.read()
    read
    public int read()
             throws IOException
        Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.
        Subclasses that intend to support efficient single-character input should override this method.
        Returns:
            The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached
        Throws:
            IOException - If an I/O error occurs

  • Need to delete multiple documents at the same time from micro soft word

    I am trying to delete multiple documents  at one time from my word ??

    one way would be to click on "documents" in the sidebar of finder.  Select multiple documents by holding the shify key while you click and drag them to the trash.

  • Reading a string one character at a time

    Hi,
    I'm hoping you use SmallBasic for year 10 exam students at my school.  But, I have found a problem I cannot solve.
    I need to be able to read one character at a time from a string (txt file) and convert each char to its ACSII code.
    How do to I read one char at a time from a string to enable processing?
    Thanks for your help.
    Baz 

    Here is an over the top solution that will display the Hex value of the character codes of every character in the file.
    TextWindow.Write("Enter full file name: ")
    filnam = TextWindow.Read()
    contents = File.ReadContents(filnam) 'read the entire file
    TextWindow.Clear()
    TextWindow.WriteLine("File Name: " + filnam)
    TextWindow.WriteLine("Offset: 0")
    col = 0
    row = 5
    TextWindow.CursorLeft = col
    TextWindow.CursorTop = row
    For i= 1 To Text.GetLength(contents)
    ch = Text.GetSubText(contents, i,1)
    chVal = Text.GetCharacterCode(ch)
    ConvertToHex()
    TextWindow.CursorLeft = col
    If chVal < 32 Then
    TextWindow.Write(".")
    Else
    TextWindow.Write(ch)
    EndIf
    TextWindow.CursorLeft = 20 + 2 + (col * 3)
    TextWindow.Write(Text.GetSubText(hexstr,1,2))
    col = col + 1
    If col = 8 Then
    col = col + 1
    EndIf
    If col > 16 Then
    col = 0
    row = row + 1
    If row > 20 then
    TextWindow.CursorTop = 23
    TextWindow.CursorLeft = 25
    TextWindow.Write("< < < Press ENTER to Continue > > >")
    TextWindow.Read()
    TextWindow.Clear()
    TextWindow.WriteLine("File Name: " + filnam)
    TextWindow.WriteLine("Offset: " + i)
    row = 5
    EndIf
    TextWindow.CursorTop = row
    EndIf
    EndFor
    TextWindow.WriteLine("")
    TextWindow.WriteLine("")
    Sub ConvertToHex
    HexValue[0] = "0"
    HexValue[1] = "1"
    HexValue[2] = "2"
    HexValue[3] = "3"
    HexValue[4] = "4"
    HexValue[5] = "5"
    HexValue[6] = "6"
    HexValue[7] = "7"
    HexValue[8] = "8"
    HexValue[9] = "9"
    HexValue[11] = "A"
    HexValue[12] = "B"
    HexValue[13] = "C"
    HexValue[14] = "D"
    HexValue[15] = "E"
    val = chVal
    hexstr = "h" 'Need to force Small basic to concatenate rather than add
    While val > 0
    hexPos = Math.Remainder(val, 16)
    hexstr = HexValue[hexPos] + hexstr
    val = Math.Floor(val / 16)
    EndWhile
    For hi = Text.GetLength(hexstr) To 2
    hexstr = "0" + hexstr
    EndFor
    EndSub
    Enjoy!

Maybe you are looking for