songtype.java

来自「mp3播放功能」· Java 代码 · 共 39 行

JAVA
39
字号
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 + =
减小字号Ctrl + -
显示快捷键?