title: How to remove an Object from a file?
body: <p>How to delete an Object from a file ??<br></p>
  
  <pre><code>           DefaultListModel model = (DefaultListModel) list.getModel();
              int selectedIndex = list.getSelectedIndex();
              if (selectedIndex != -1) {
  
                  model.removeElement(list.getSelectedValue());
                 }
  </code></pre>
  
  <p>with this code I am able to delete only from the list. Is there a code to remove object from the list and file ?</p>