Yes you can trim Java Moss nearly anywhere, but keep in mind that Java Moss also removes Nitrates from your water. You can cut and tie it to something else or put some on a piece of cork board and let the moss suspend from the top of the tank.
Java moss! I LOVE Java moss! I got my first batch of it Friday. Low light plant, little care required. Read the plant forum at Killies.com, TONS of moss info there!