}
public static File createFileFilter(Component parent,String dialogBtnKey,String fileExt){
String lastLoc=null;
ApplicationScopeObject appScopeObj=ApplicationScope.getObjectFromScope(AppScopeConstants.LAST_FOLDER);
if(appScopeObj!=null) {
lastLoc = (String) appScopeObj.getDto();
}
JFileChooser fileChooser=new JFileChooser(lastLoc);
if(fileExt!=null) {
createAndSetFileFilter(fileChooser,fileExt);
}
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int userChose=fileChooser.showDialog(parent,Properties.getAppProps(dialogBtnKey));
if(userChose==JFileChooser.APPROVE_OPTION){
ApplicationScope.addObjectToScope(AppScopeConstants.LAST_FOLDER, new ApplicationScopeObject(fileChooser.getSelectedFile().getParent()));
return fileChooser.getSelectedFile();
}
return null;
}