int result;
if (isFileLoad) {
fc.addChoosableFileFilter(new BitMapFilter());
fc.addChoosableFileFilter(new JpegFilter());
fc.addChoosableFileFilter(new PngFilter());
result = fc.showOpenDialog(frame);
} else {
fc.setFileFilter(new PngFilter());
result = fc.showSaveDialog(frame);
}
if (result == JFileChooser.APPROVE_OPTION) {
selectedFile = fc.getSelectedFile();