f



Deleting selected text from text area

 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() );

    }

0
tom79l (2)
4/12/2007 11:26:12 AM
comp.lang.java.help 13340 articles. 0 followers. Post Follow

2 Replies
1426 Views

Similar Articles

[PageSpeed] 30

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
0
Lew
4/12/2007 12:34:04 PM
tom79l@googlemail.com wrote:
>I was wondering if anyone could help. ...

People are already trying to help you.  On *this* thread.
<http://www.javakb.com/Uwe/Forum.aspx/java-setup/10421/Text-Area-Help>
Please refrain from starting new threads, it serves no 
purpose.

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

0
Andrew
4/12/2007 12:36:18 PM
Reply: