Lab6 Done Done
This commit is contained in:
parent
9f6383ed44
commit
7acc834a14
@ -17,23 +17,6 @@ import java.io.FileNotFoundException;
|
|||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class TxtSaveFilter extends FileFilter {
|
|
||||||
@Override
|
|
||||||
public boolean accept(File f) {
|
|
||||||
if (f.isDirectory()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String s = f.getName().toLowerCase();
|
|
||||||
|
|
||||||
return s.endsWith(".txt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDescription() {
|
|
||||||
return "*.txt";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class FrameBusCollection extends JFrame {
|
public class FrameBusCollection extends JFrame {
|
||||||
private BusesGenericStorage storage;
|
private BusesGenericStorage storage;
|
||||||
private JList<String> listBoxStorages;
|
private JList<String> listBoxStorages;
|
||||||
|
20
src/TxtSaveFilter.java
Normal file
20
src/TxtSaveFilter.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import javax.swing.filechooser.FileFilter;
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class TxtSaveFilter extends FileFilter {
|
||||||
|
@Override
|
||||||
|
public boolean accept(File f) {
|
||||||
|
if (f.isDirectory()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String s = f.getName().toLowerCase();
|
||||||
|
|
||||||
|
return s.endsWith(".txt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return "*.txt";
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user