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
Post a Comment