Who knows about M.A.M.E.?

When i finish my platform game I really want to be able to run it on my friends arcade cabinet, which is a MAME.

Does anyone know if a java game can be ported to mame or can be run through mame?

Are there alternatives? Like running the game on the machine, via the PC but accessing it through the mame front end?

Ideally it should be able to show up in the games list and run without having to close the emulator and open something else.

Feel free to spitball any ideas too.

Thanks.