imagefilechooser.java

来自「JAVA 实现虹膜识别(完整)」· Java 代码 · 共 48 行

JAVA
48
字号
package IrisRecog;

/**
 * ImageFileChooser.java
 * 
 * Extends the JFileChooser swing component by adding an image preview pane
 * to the right and setting the filter to select only jpg/jpeg images.
 *
 * @owner Michael Huffman
 * @author Team 6: A. Bare, I. Chaugule,M. Huffman, M. Pearson, C. Schell
 * @version 0.0.1
 *
 * 	CSC 480 Section 2
 * 	Fall 2005
 * 	10/2/05
 *
 * Edit History:
 *  10/2/05 - created
 */
 
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.filechooser.*;

public class ImageFileChooser extends JFileChooser 
{    
	/**
	 * Constructs a new file chooser to find image files
	 */
	public ImageFileChooser() 
    {
		this.addChoosableFileFilter(new ImageFilter());
		this.setAcceptAllFileFilterUsed(false);
		
		try
		{
			//Set the default directory to the image folder
			this.setCurrentDirectory(new File("../images"));
		}
		catch(Exception e) { }
		
		//Add the preview pane.
		this.setAccessory(new ImagePreview(this));
	} 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?