java - delete selected text from JScrollpane -


i developing gui in java using netbeans ide , swing forms. here want delete selected text jscrollpane using delete button have added using add button. able delete entire text not selected one. have searched on internet not help. below code have tried. suggestions helpful me.

private void buttondelactionperformed(java.awt.event.actionevent evt) {                                               jfilechooser chooser = new jfilechooser();     filefilter ft = new filenameextensionfilter( "arxml files", "arxml" );     chooser.setfilefilter(ft);     jscrollpane1.getcontainerlisteners();      chooser.setmultiselectionenabled(true);     joptionpane.showconfirmdialog(frame, "you selected : " + list.getselectedvalue());     if (evt.getsource() == buttondel )     {          file[] files = chooser.getselectedfiles();         log.settext("");     } 

your jscrollpane must have jtextarea putting content. add listener jtextarea , selected text on action performed. delete selected text


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -