There were several moments when Japan had an opportunity to exit the dispute without looking like the losers. The first, on the day the incident happened, September 7th, when they picked up the Chinese crew after the confrontation in the East China Sea. They could have doled out a few words of admonishment, sent a curt message to Beijing, and then let the Chinese fishing boat go.
In the following days, as the Japanese ambassador was angrily summoned to the Chinese foreign ministry at all hours of the day, Japan had another face-saving chance to free the captain. On humanitarian grounds, perhaps using the common diplomatic excuse of the detainee in bad health. But Tokyo didn't.
When Japan finally blinked in the stand-off with China, it was badly-timed - and looked plain ugly.
Badly timed, because it came after a 48-hour flurry of developments that included the rumour China was holding off exports of rare earth minerals to Japan (