Results 1 to 7 of 7

Thread: why is this not working?{resolved}

Threaded View

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Resolved why is this not working?{resolved}

    I have a JtextArea named textArea2 and I want to search for text and then select it.
    My code is not working and I don't know what could possibly be wrong with it.

    Code:
     String textSearch = JOptionPane.showInputDialog("Enter a string to search for");
    	int left = textArea2.indexOf(textSearch);
    	int right = textArea2.lastIndexOf(textSearch);
                    textArea2.select(left,right);
    Last edited by System_Error; Nov 18th, 2004 at 06:19 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width