You can protect your code using
obfuscators.
Here is link for free solutions:
Open Source Obfuscators in Java
If someone decompiles your bytecode (check online utilities for this!)
he can extract a lot of info about your code,
so be sure your obfuscator removes
all useful comments
and refactor all classes and methods to some meaningless
and long names that are hard to understand.
Once you obfuscate your code, decompile it to see result,
notice a lot of trash code with no functionality at all,
which obfuscator added to your src code just to make it harder to read.
good luck!