Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public void saveAK() {
  2. JFileChooser chooser=new JFileChooser();
  3. if(Chooser.showsaveDialog(this)==JFile Choose.APPROVE_OPTION)
  4. {
  5. try{
  6. FileWriter fw=new FileWriter(chooser.getSelectedFile().getAbsolutePath());
  7. PrintWriter pw= new FileWriter(fw);
  8. for (book.list){
  9. string[]parts=x.getAuthor().split(" ");
  10. if(parts[1].charAt(0)>='A' && parts[1].charAt(0)<= 'K')
  11. pw.println(""+x);
  12. }
  13. fw.close();
  14. }catch (IOException ex){}
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement