I am writing a desktop application using Java Swings. I need to simulate credit card payments so that with sample credit card numbers a real payment (card apparently processed and response received) could be simulated. Is there any free tool or software that I can use to do this?
You can do that via Paypal Developer Tools.
It will be from your end the same as a real paypal credit card transaction. I haven't used it with Java so I can't comment on any specific tricks to make it work best for that. If after reading those docs you get stuck at all I'd suggest asking a question on SO.