Step 4: The Java Perspective
The primary windows (called "views") in the Java perspective are
- The "Package Explorer" on the left part of the screen
- The "Editor" window in the middle of the screen
- The tabbed "Problems" and "Console" windows at the bottom of the screen
We'll look at other windows later in the semester
The Package Explorer Window
The Package Explorer window shows the directory structure for your workspace. Directories can be opened or closed by clicking on the small boxes which contain "+" and "-" Files may be opened for editting by double-clicking the file name.
The Editor Window
This window is used to create and edit your source code (.java files). The editor is "Java aware" and provides many helpful features as you develope your code. Several files may be editted at the same time. Each filename appears as a tab within the Editor window.
Some helpful features of the Editor window include
- Automatically indenting code
- Automatically inserting closing braces
- Automatically inserting closing quotes
- Alerting you to misspelled identifiers
- Providing hints for the names of methods as you type
- Prompting you for the types of parameters to a method
- Alerting you to compiler errors as you type
When the editor believes you have an error, a small icon appears in the small left margin. If you hover the cursor over the icon, Eclipse will give you hints to help you fix the error.
- Automatically compiling your code when you "save" your code
- Allowing you to expand or collapse parts of your code allowing you to hide code that is not currently of interest
The Problems Window
The Problems window lists compiler errors and runtime errors found in your code. If a compiler error is found, the Problems window displays the name of the file and the line number on which the error occurred.
The Console Window
This window acts like the user output console. Any output that would appear on the users screen appears in this window.