📄 songtype.java
字号:
package Function;
import java.io.File;
import javax.swing.filechooser.FileFilter;
/**
* The class extends class FileFilter.It
* is designed to set the format of files
* that are belong to song types.
*
* @author DuXiaojing
*
*/
public class SongType extends FileFilter{
/**
* The method set the state of a file to
* judge whether the file is a song types
* or not.
*
* @param pathname
* @return Returns the state of a file
*/
public boolean accept(File pathname) {
// TODO Auto-generated method stub
return pathname.isDirectory() || pathname.getName().endsWith(".mp3");
}
/**
*
* @return Returns string "song types"
*/
public String getDescription() {
// TODO Auto-generated method stub
return "Song types";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -