That's the whole point of any
Java application. Theoretically you can compile a program once and install it anywhere. The same is true for J2ME. In fact, this is the main reason why most features are very limited. You are unable to make Palm OS or any other system calls. This is the price you pay for the portability, but often it can be worth it.
To reiterate, you can write a J2ME program that will run on any platform that has a JVM installed. (Note: Midlets must be converted to PRC files in order to install to Palm-based devices. The midlet code itself is exactly the same as for any other device, though.)