how can i just show the lines which contains the searched string in textarea Java? -


this code snippet. instead of printing in console how can refine in text area itself. tried textarea.write(line) throws error.

public void search() {     hilit.removeallhighlights();      string s = entry.gettext();     if (s.length() <= 0) {         message("nothing search");         return;     }     scanner in = null;      in = new scanner(textarea.gettext());     while(in.hasnext())     {         string line=in.nextline();          if(line.contains(s)){             system.out.println(line);         }     } 


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -