Format. The source menu contains a command called “Format”. Please be sure to use this
command on your Java code. It will ensure that your program is indented reasonably.
Organize imports. This command is also in the Source menu. It arranges your import
statements alphabetically and also helps create the import statements for you so that you
import individual classes (like java.awt.Color) rather than entire packages (like java.awt.*).
Preferences
There are also many preference settings available in Eclipse. You can leave most of these at
their default values until you become comfortable and want to start exploring Eclipse’s
power. I do, however, suggest that you change some of the settings concerning the warning
messages that Eclipse provides. By doing so, Eclipse will be able to help you out by
identifying some potential errors in your code that are technically legal, but rarely good
ideas. To do that select the Preferences command from the Eclipse menu. Open the Java
preferences, then the Compiler preferences and select Errors/Warnings. You should have a
window that looks something like this:
Open the “Potential programming problems” in the right panel. Make sure that the following
are set to “Ignore”:
•
Serializable class without serailVersionUID
•
Boxing and unboxing conversions
Make sure that the remaining choices are all set to Warning.
Commentaires sur ces manuels