Choose File Through JFileChooser.


 JFileChooser fc = new JFileChooser();
                        String desc = "Excel ( *.xls)";
                        String[] types = {".xls"};
                        fc.addChoosableFileFilter(
                            new FileNameExtensionFilter(desc, types));

                        int returnval = fc.showOpenDialog(null);
                        if (returnval == JFileChooser.APPROVE_OPTION) {
                            File file = fc.getSelectedFile();
                    jTextField1.setText(file.getPath());
                          
                        }

Popular posts from this blog

Simple Sign up design. Android.

Cart page design in android.

Set Date on jDateChooser and retrieve record from database.