There are two solutions. You could either use the pcapi or send messages between nxt and PC. If you use the pcapi no program is needed on the nxt because it sends so called direct commands to the nxt. On the nxt could run the lego firmware and it should work.
If you send messages your server program only needs to forward the commands from the applet to the nxt.
Its pretty easy to use the pcapi: You must only include the classes.jar(?) From lejos-folder/lib/pc . Then you can write for example: Motor.A.rotate(); See the code from my site: http://backsite.wordpress.com/2012/05/1 ... torms-nxt/
You should find many tutorials about bluetooth communication between nxt and pc.
In this post is an example for the pcapi : viewtopic.php?f=5&t=3397
And here is a remote project with lejos and pc code: viewtopic.php?f=5&t=840
Good luck and feel free to ask here or in german on my site.