I trying to save my contact in my table but filechosser always setit to all file. is there way I can set it to accept .txt only and make it default or the only option. >
You could do that by using FileFilter.
Create a Filefilter with the necessary conditions. Set this file filter to the JFileChooser, and launch it.
Filefilter
JFileChooser