Notice
		                                        
										
                                    
                                        
                                    
                                        Recent Posts
                                        
                                    
                                        
                                    
                                        Recent Comments
                                        
                                    
                                        
                                    
                                        Link
                                        
                                    
                                | 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | 
| 30 | 
                                        Tags
                                        
                                    
                                        
                                    - Sqoop
 - vaadin
 - mapreduce
 - window
 - xPlatform
 - Java
 - Android
 - R
 - es6
 - table
 - SSL
 - SPC
 - react
 - 공정능력
 - Kotlin
 - JavaScript
 - MSSQL
 - IntelliJ
 - plugin
 - mybatis
 - tomcat
 - Spring
 - GIT
 - Python
 - hadoop
 - SQL
 - 보조정렬
 - NPM
 - Eclipse
 - Express
 
                                        Archives
                                        
                                    
                                        
                                    - Today
 
- Total
 
DBILITY
java swing file open 본문
반응형
    
    
    
  VS계열이나 Delphi 등의 IDE기반 툴에서 했던 것과 유사합니다. 
역시 경험은 중요한 것~한가지를 경험하지 않으면 한가지 지혜가 자라지 않는다는 명심보감(?)의 말씀이 떠오르는 오후~
package com.dbility.apps;
 
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter;
 
public class FileOpen extends JFrame {
 
    private static final long serialVersionUID = 511012135676462354L;
 
    public static void main(String[] args) {
 
        JFileChooser jfc = new JFileChooser();
 
        jfc.setDoubleBuffered(true);
        jfc.setMultiSelectionEnabled(false);
        jfc.setFileFilter(new FileNameExtensionFilter("HWP File", "hwp"));
 
        int retVal = jfc.showOpenDialog(null);
 
        if ( retVal != JFileChooser.APPROVE_OPTION ){
            JOptionPane.showMessageDialog(null, "파일을 선택하라 말이야");
            return;
        }
 
        JOptionPane.showMessageDialog(null, jfc.getSelectedFile().getPath());
    }
 
}
반응형
    
    
    
  'java > basic' 카테고리의 다른 글
| maven jar build main (startup) class setting ( jar 시작클래스 지정) (0) | 2016.11.12 | 
|---|---|
| svn admin command (명령) (0) | 2016.11.02 | 
| maven jar build시 meta-inf 제거 (0) | 2016.10.21 | 
| maven jar packaging specific class excluding ( java 클래스 제외 ) (0) | 2016.10.03 | 
| java spring atomikos Connection Pool Exhausted Exception (0) | 2016.09.23 | 
                          Comments
                        
                    
                
            
                
            
				
				
				
				
                
							