Examples of JnexFileChooser


Examples of com.nexirius.framework.swing.JnexFileChooser

        javax.swing.SwingUtilities.invokeLater(new ShowFileDialog());
    }

    public class ShowFileDialog implements Runnable {
        public void run() {
            JnexFileChooser chooser = DialogManager.getFileChooser(null);

            if (getModel() instanceof DirNameModel) {
                chooser.getJFileChooser().setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            } else {
                chooser.getJFileChooser().setFileSelectionMode(JFileChooser.FILES_ONLY);
            }

            String fileName = null;

            if (getModel().getText().length() > 2) {
                fileName = new File(getModel().getFullName()).getPath();
            } else if (getModel().getBrowseDirectory() != null) {
                fileName = getModel().getBrowseDirectory().getText();
            }

            File theFile = chooser.popupOpenDialog(fileName);
            if (theFile != null) {
                getModel().setText(theFile.getAbsolutePath());
                getModel().fireEditEvent(getModel(), DataModelEvent.VALUE_EDIT);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.