PIbd-23. Zakharov R.A. Lab work 05 #6

Closed
Zakharov_Rostislav wants to merge 10 commits from Lab5 into Lab4
Showing only changes of commit a8d164c663 - Show all commits

View File

@ -258,6 +258,7 @@ public class FrameShipsCollection extends JFrame {
}
private void loadFile(){
JFileChooser fc = new JFileChooser("C:\\Users\\user\\Documents");
fc.addChoosableFileFilter(new TxtFilter());
int ret = fc.showDialog(null, "Открыть файл");
if(ret == JFileChooser.APPROVE_OPTION){
File file = fc.getSelectedFile();
@ -273,6 +274,7 @@ public class FrameShipsCollection extends JFrame {
private void loadSet(){
JFileChooser fc = new JFileChooser("C:\\Users\\user\\Documents");
int ret = fc.showDialog(null, "Открыть файл");
fc.addChoosableFileFilter(new TxtFilter());
if(ret == JFileChooser.APPROVE_OPTION){
File file = fc.getSelectedFile();
try {