Although I can only speak accurately about becoming a Navy/Marine Corps JAG Officer, am I sure the other branches do not deviate very substanially.
There are three ways to becoming a Navy JAG.
One is by direct appointment (DA). You have already graduated from law school and apply to become a commissioned officer.
Two is by legal education program. You are currently in the military as a normal commissioned officer, you apply and if accepted the military will send you to (and pay) for your law school. However only 25 applicants are accepted every fiscal year.
Finally, I forgot what its called but its the most common path for becoming a JAG. While in law school, you apply to be a JAG. Its sorta like ROTC minus the money. You apply your second or third year and from time to time do PT or drill or various other military activities. However, during this time you are actually commissioned as an officer and get paid as a lieutenant junior grade (0-2) instead of an ensign (0-1) upon getting your JD.
And as MayitPleaseMe correctly pointed out, the Army, the Navy, and the Air Force have "full-time" JAGs. Although Navy Judge Advocates and Marine Judge Advocates fall under a single command under the Secretary of the Navy, Marine JAs (like all Marine MOSs) are expected to be able to lead the appropriate infantry unit. In the Corps, everyone is a rifleman. Clerks are riflemen. Supply are riflemen. Armor are rifleman. And attorneys are riflemen.
Hope that helped.