To copy or move a program element:
You can copy or move a package from one project to another project
You can copy or move a class from one package to another package.
You can copy or move a method or field from one class to another class.
Copying and moving program elements can introduce problems. The changes are compiled immediately, and problems are added to the Problems page of browsers.
If the program element happens to be a visual composite, delete its generated main() method, regenerate code for the composite, and save it.