Is it still eating? If so, there's a good chance he'll be okay. My molly had a swim bladder issue a few weeks ago, but still had an appetite, and was fine in a couple of days.
Constipation can cause swim bladder issues...try feeding crushed frozen peas (recommended to me by nmonks, they work wonders), and give him a couple of days.