요넘 예전에 공부하다가 대충 훌터보고 넘겼었는데.. 드디에 사용하게 되는구만..

가끔 엑셀로 데이터를 주면서 배치작업을 요청 하는 경우가 있더라.. 뭐.. 텍스트 파일로 옮긴 후 처리를 하곤 했지만.. 내가 계속 해주기 귀찮더라이거지.. 그래서 아싸리. UI 프로그램을 하나 주면 편할 듯 싶어서 작업을 하게 됨.

Example
private JFileChooser fileChooser = new JFileChooser();

fileChooser.setDialogTitle("Excel Load");
fileChooser.setFileFilter(new TypeOfFile());

TypeOfFile
- 요넘.. 어딘가에서 가져왔지만. 까먹음.. 흠...
import java.io.File;
import javax.swing.filechooser.FileFilter;

/**
 *
 * @author 0216
 */
public class TypeOfFile extends FileFilter {
     //Type of file that should be display in JFileChooser will be set here
     //We choose to display only directory and text file
     public boolean accept(File f)
     {
        return f.isDirectory()||f.getName().toLowerCase().endsWith(".xlsx");
     }

     //Set description for the type of file that should be display
     public String getDescription()
     {
        return ".xlsx";
     }
}

Posted by 짱가쟁이