Any decent IDE or programmer's editor will do this; everything from Emacs to Eclipse. If JEdit seems to be formatting the code as if braces inside a comment are significant, perhaps the problem is that the comment itself is messed up. Is there a "*/" inside a block comment? Is there a space between the slashes in a "//" ? Another thing a decent editor will do is syntax coloring, and if you see a colored version of your source, this can be a quick way to see that a comment is being interpreted incorrectly.