If I do swimming can I get a more decent body than going to the gym?
It depends on your goals.
I'm presuming by "gym" you mean weight training.
You'll develop great cardiovascular abilities and a certain amount of strength swimming. You get a lot of bang for your buck because it is a full-body exercise.
You will develop a lot more flexibility.
You won't, however, get the bone-strengthening benefits from exercise that opposes gravity (walking, running, weight training, high impact aerobics...)
The reality is that the best workout is the one that you'll do that helps you meet your goals. If it's to keep your heart healthy, to be flexible and strong, yes, swimming is amazing.
If it's to run a marathon, running would be better.
If it's to develop large muscles, it would be better to lift weights.
If it's to be an amazing person, of course you'll swim ;) Swimmers are awesome.