Hi. I'm 17 and I recently started dating with a friend of mine (we will be together for a month on 8/9/0

.
While this might be a bit embarrassing to say, I was a pervert. Not the kind of pervert that feels girls in the subway, but the home-porn kind of pervert.
Since i have been with my girlfriend i stopped masturbating and watching porn (before i got together with her i masturbated quite often).
Yesterday night we went to a club with some other friends. Whenever i was with her, I'd get a boner, but if she moved away to be with her friends, or going to the bathroom, I'd settle down! We haven't moved past kissing yet, and this is happening to me!
I've tried to prevent this from showing by using tight boxers (to prevent my penis to "pop" out). So far this has worked, but some friends have been organizing a beach party, and i'm terrified I get a boner in the beach, because this time i won't be able to hide it!
Is there anything i can do to stop this from happening?