The use of a swim-bladder exists in ray-finned fishes only, and is quite a tool in controlling the fishs ability to swim at surface levels or deeper levels. The swim-bladder is fairly elastic and can get larger, accomodating more gas, which would make the fish more buoyant due to it's larger volume. By the same mechanism, the swim-bladder can get smaller, reducing the volume of gas, which would also reduce the amount of buoyant force on the fish, since it now occupies a smaller volume, which would make it less buoyant in the water. The same principle is employed on modern submarines in assisting them to surface or dive, by flooding ballast tanks with water, then flushing the water out with compressed air, which would increase the buoyancy of the submarine. The mass of the fish would remain the same, but if you inflate the sim-bladder, that would increase the volume number, thus giving a smaller density number, which would heighten the ability of the fish to float in the water.