The Java Perspective

The primary windows (called “views”) in the Java perspective are:

  1. The Package Explorer on the left part of the screen
  2. The Editor window in the middle of the screen
  3. The tabbed Problems and Console windows at the bottom of the screen

Views in Java Perspective

We'll look at the other tabbed windows later in the semester. For now, you can close the unused tabs named “Hierarchy”, “Outline”, “Javadoc”, and “Declaration”.

You can rearrange the remaining windows to your liking. Try dragging the “Problems” tab to the right of the “Console” tab.

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 right or down arrows, respectively. Files may be opened for editing 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 develop. Several files may be edited at the same time. Each filename appears as a tab within the Editor window.

Some helpful features of the Editor window include:

  1. Automatically indenting code
  2. Automatically inserting closing braces
  3. Automatically inserting closing quotes
  4. Alerting you to misspelled identifiers
  5. Providing hints for the names of methods as you type
  6. Prompting you for the types of parameters to a method
  7. Alerting you to compiler errors as you type
    When the editor believes you have an error, a small yellow icon appears in the left margin. If you hover the cursor over the icon, Eclipse will give you hints to help you fix the error.
  8. Automatically compiling your code when you “save” your code
  9. 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 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 terminal if you were to run your Java programs from the command line. The output of print statements appears in this window.