I have a Jtextarea and keypad, the keypad is used to enter text to the JtextArea. I have a button on the keypad that is used for two things:
1. To move back through the text
2. To delete a character at a time
I do not kno how to go about deleting a character at a time, i have tried using deletCharAt() and giving the position to delete.
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());
}
This results in the following error cannot find symbol method deleteCharAt().
Txtmsg is a variable of type string, and display is the name for the JtextArea.
Any help appreciated, thanks.