Package com.nexirius.framework.swing

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

Related Classes of com.nexirius.framework.swing.JnexFileChooser

Copyright © 2018 www.massapicom. 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.