Here you can find the source of save(JFileChooser fileChooser, Runnable action)
public static void save(JFileChooser fileChooser, Runnable action)
//package com.java2s; //License from project: Open Source License import javax.swing.JFileChooser; public class Main { public static void save(JFileChooser fileChooser, Runnable action) { if (fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) { action.run();//from w w w. j a v a 2 s . com } } }