Apache NetBeans Wiki Index

Note: These pages are being reviewed.

Here’s the source of this FAQ:

Just wanted to put the core of it here for future reference as this was not easy for me to find:

                File projectToBeOpenedFile = new File(getPath());
                FileObject projectToBeOpened = FileUtil.toFileObject(projectToBeOpenedFile);
                Project project = ProjectManager.getDefault().findProject(projectToBeOpened);
                Project[] array = new Project[1];
                array[0] = project;
                OpenProjects.getDefault().open(array, false);

Remember to add references to Project API and Project UI API.

Go to the link to see the explanation of the code.

Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.

This page was exported from http://wiki.netbeans.org/DevFaqOpenProjectProgramatically , that was last modified by NetBeans user Javydreamercsw on 2011-07-28T14:00:45Z.

NOTE: This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.