Java Reference
In-Depth Information
figure 3-7  
In the Window menu, you can change the perspective, for instance the Debug perspective includes the
views linked to the debugging facilities in Eclipse. You can close or minimize views by clicking the x or ‐ in
the top‐right corner of each view, similar to how you close and minimize windows in the Windows operat-
ing system. You can add other views by selecting Show View from the Window menu (see Figure 3-8). You
can rearrange the views in your workbench by clicking and dragging on the title bar of the view.
One recommendation for customizing your Java perspective is to remove the Package Explorer and
replace it with a Project Explorer. The two look very similar in that they show you a list of your
projects and the packages and classes included in them. However, the Project Explorer will display
a red “x” on classes that have unresolved errors. This makes it much easier to spot code that needs
your attention, especially when you start working with multiple classes in the same project.
To close the Package Explorer, you can just click the white “x” in the top‐right corner of the Package
Explorer tab. You'll notice when you close it, your Code Editor will stretch to fill the space. To add the
Project Explorer, click Window and choose Show View. If Project Explorer is displayed there, you can
select it. If not, click Other and you'll find it in the General folder. When you open the Project Explorer, it
will take the place of the Package Explorer, and the Code Editor will shrink back to the center again.
Java programs are organized in a project hierarchy in Eclipse, as depicted in Figure 3-9. Projects
are the top‐level folder. You should use one project for each program you are working on. Projects
are divided into packages that keep related Java classes together. Packages are a Java construct that
serves not only to organize your class files, but also allows you to specify a specific class based on its
Search WWH ::




Custom Search