I agree with sylvia, also some swim bladder problems can be genetic- deformed fry from inbreeding often suffer from swimbladder problems at an early age in their lives but unfortunatly there's not alot you can do about this, either the fry corrects itself or it has to be put down as this kind of swimbladder problem is pretty much uncurable and is often seen in inbred livebearer fry.
Also swimbladder problems can be caused by bad water quality- improving the water quality will help the fish's condition but at best there is only a 50/50 recovery rate, and thats if you catch it very early on and treat the fish accordingly.
When a fish is suffering from a swimbladder disorder also moving it to a place with shallow water(i.e breeding net/trap) will help alot as the fish will find it easier to maintain its balance in shallow water and so help improve its chances of recovering. Most fish though die from swimbladder disorders not due to the disorder itself but the fish's lack of ability to aim for food to eat as its condition worsens and so starves to death- when a fish can no longer eat it is best to put it down as there is no hope when it reachs this stage.
In this scenario though, not only feeding it vegetable based foods like cooked de-shelled peas or algae wafers will help but also feeding it foods that stay floating in the water for a long time like freezedried daphinia, tubifex or bloodworms as these foods are easier to eat for the fish because of this reason.