Lab6 #8

Merged
Zakharov_Rostislav merged 6 commits from Lab6 into Lab5 2024-03-10 18:15:01 +04:00
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 {