As far as I understand it the Japanese people were fed an entirely propagandized view of the war (like everyone) and they were deeply entrenched in nationalism. They believed they could never lose and they were superior. I'm curious as to if a specific event or a series of events significantly effected public confidence. I'm especially curious if anything like this happened before Okinawa and the massive bombing campaign against the mainland.
An earlier answer was provided During WWII, what did the Japanese public know about the accumulating losses in the Pacific Theater? by /u/poots953.
I will add to your slightly different question that although Japan knew they were losing the war in 1945 due to the constant air raids, they never thought they would actually lose. A famous image, well-known even to young Japanese people today, is the training of civilians to fight with bamboo spears. "Civil defense" training, actually a sort of suicide warrior training, was mandated from the top and took place throughout the country. By 1945, Japan's war planners genuinely believed that it would become a permanent guerrilla war, with Americans shooting Japanese and Japanese spearing Americans either until every Japanese person was killed or until the Americans became exhausted and left.
There were of course many Japanese people who thought this scenario was absurd, including Diet members and some military commanders, which is how they got the Emperor to surrender in August. But at the level of ordinary people, such dissent was dismissed when voiced openly, and if the dissenter was persistent the police might be called on them. This hypothetical scenario actually became reality in Okinawa, with many horrible mass suicides and starvation.
There is an interesting translated primary source, Hiroshima Diary by Michihiko Hachiya, which describes the total shock of a doctor treating radiation victims to learn that Japan had surrendered -- despite the fact that he was working in the charred ruins of a completely vaporized city. For Dr. Hachiya there was no such thing as surrender until the Emperor made it possible. This view was shockingly widespread in Japan, so there was no concern about "public confidence"; furthermore, the American military officials were well aware of this, which was one of the reasons they chose to drop atomic bombs instead of preparing for land war.