I made an applpication and I want to distribute it on the internet but I want to know if there is a way to put all my code on a jar file and make that no one can open it and decompile my class files.
You need to do a search for obfuscators, which make it very difficult to decompile and understand your source code. This has been discussed here alot, or you can do a google search.
"JavaRanch, where the deer and the Certified play" - David O'Meara