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