Lab6 finished+

This commit is contained in:
Artyom_Yashin 2023-12-20 20:20:36 +04:00
parent 7491ceaca0
commit cf238cb347
2 changed files with 3 additions and 1 deletions

View File

@ -48,7 +48,6 @@ public class PlaneGenericStorage {
public boolean LoadData(File f) throws FileNotFoundException {
if(!f.exists())
return false;
System.out.println("Gay");
StringBuilder bufferTextFromFile =new StringBuilder();
Scanner s = new Scanner(f);
while(s.hasNext())

View File

@ -136,6 +136,7 @@ public class FramePlaneCollection extends JFrame {
private void saveFile_Click(){
JFileChooser fc = new JFileChooser("C:\\Users\\123\\Desktop");
fc.addChoosableFileFilter(new TxtSaveFilter());
fc.addChoosableFileFilter(new TxtSaveFilter());
int retrieval = fc.showSaveDialog(null);
if (retrieval == JFileChooser.APPROVE_OPTION) {
@ -150,6 +151,7 @@ public class FramePlaneCollection extends JFrame {
}
private void loadFile_Click() {
JFileChooser fc = new JFileChooser("C:\\Users\\123\\Desktop");
fc.addChoosableFileFilter(new TxtSaveFilter());
int ret = fc.showDialog(null, "Открыть файл");
if(ret == JFileChooser.APPROVE_OPTION){
File file = fc.getSelectedFile();
@ -186,6 +188,7 @@ public class FramePlaneCollection extends JFrame {
private void loadCollection_Click() {
JFileChooser fc = new JFileChooser("C:\\Users\\123\\Desktop");
fc.addChoosableFileFilter(new TxtSaveFilter());
int ret = fc.showDialog(null, "Открыть файл");
if(ret == JFileChooser.APPROVE_OPTION){
File file = fc.getSelectedFile();