# Creating Subprojects

Projects can include subprojects. Subproject's are useful when you have a program that adds packages. You can create a project for the program and a subproject for each package.

Subprojects are created using the same Create Project wizard that you use when you create a project.

To create a subproject within a project:

1. Click the Project's button on the Java WorkShop main toolbar.
2. In the project manager, double-click on the project name in which you want to include a subproject.
3. Choose File -> New -> Subproject.
   The Create Project wizard is displayed.
4. Complete the Create Project wizard using your subproject information.

## Example

Suppose you want to create a project with many subprojects, each of which has `.java` files:

  `/tina/myproj/main`--contains `Main.java` and several other `.java` files
  `/tina/myproj/main/readers`--contains several `.java` files
  `/tina/myproj/main/writers`--contains several `.java` files
  `/tina/myproj/main/utils`--contains several `.java` files

Both the `readers` and `writers` subprojects have `.java` files that are added from `utils`.
To set up the example:

1. Create a project named `Main` in the `main` directory.
2. Create a subproject named `readers` in the `readers` directory.
3. Create a subproject named `writers` in the `writers` directory.
4. Create a subproject named `utils` in the `utils` directory.
5. Make the `Main` project the current project and choose Project -> Edit.
6. In the Included Projects field in the General tab, list the projects as follows:
   1. `utils`
   2. `readers`
   3. `writers`

When you build the `main` project, the included projects are built in the order in which they are listed.

See also:

  Using the Create Project Wizard
  Running a Project
  Building Projects