How do I move messages between folders?

First, if you are using POP, you can't. There is only one folder, the INBOX.

If you happen to be using IMAP, the way to move messages between folders is with the appendMessages() or the copyMessages() method of Folder. In either case, you would need to delete the message from the original folder yourself.