Re: Text Area Help
tom79l@googlemail.com wrote:
String beforeS = (textArea.getText())(0,start );
There is no valid construction
(stringExpression) ( someInt, anotherInt );
It violates extremely basic rules of Java syntax.
Likewise
int length = textArea.getDocument().lenght();
(I am assuming, since you didn't post the code, that the type of 'textArea' is
javax.swing.text.JTextArea.)
There is no method in javax.swing.text.Document called "lenght()". You
already indicated that you've made editorial changes and transcription errors
in your posted code. Don't do that. Copy and paste your actual code,
preferably in an SSCCE, when posting, as with your actual error messages.
textArea.setText(beforeS+""+afterS );
Placing the empty string "" in the concatenation is unnecessary.
replaceText(String str, int start, int end);
There is no declaration of argument types in a method invocation, only in a
method declaration. This is also basic Java syntax.
I suggest that you review the Java tutorial on the basics of Java expressions.
<http://java.sun.com/docs/books/tutorial/java/nutsandbolts/index.html>
and
<http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html>
--
Lew