It would probably be better to use NetBeans and co. for the development, compiling etc. But you can usefully use MATLAB as an interactive environment for testing the code - start MATLAB with the -jdb option and attach your IDE's profiler to the specified port. Code snippets can also be tested out by running a Java console from the MATLAB command line e.g. the Groovy Console gives you a GUI for loading jars etc.
If you are on a Mac, you can even recompile, clear classes and reload the jars without exiting MATLAB - albeit with some limitations as the method signatures will be get cached.
For details, look at Yair Altman's Undocumented MATLAB blog (and book):