A sobbing Minami Minegishi apologised to her fans and said she did not want to leave the band AKB48, in the video seen by millions on YouTube.
The production company behind AKB48 said Minegishi, 20, had failed to abide by its cardinal rule - no dating.
But fans have defended her, saying she is entitled to a normal life.
Head shaving is a traditional form of showing contrition in Japan.
Minegishi's apology came hours after a tabloid newspaper published photographs of her leaving the apartment of her boyfriend, Alan Shirahama, a dancer in a boy band.
In the video posted on AKB48's official website, she said she had made the decision to shave off her long hair to show contrition for her "thoughtless and immature" actions.
"I don't believe just doing this means I can be forgiven for what I did, but the first thing I thought was that I don't want to quit AKB48," she said.
At times sobbing and bowing her head during the nearly four-minute-long video, she also said: "If it is possible, I wish from the bottom of my heart to stay in the band. Everything I did is entirely my fault. I am so sorry."
Minegishi was one of the original members of AKB48 when it was launched by producer Yasushi Akimoto in 2005. The band is made up of some 90 girls - whose ages range from mid teens to early 20s - who, in teams, appear daily in their own theatre and regularly on television, in adverts, and in magazines.
They portray an image of cuteness known as "kawaii", and have become a huge phenomenon both in Japan and increasingly in other Asian countries, correspondents say.
The condition for being part of such a successful act is that the girls must not date boys, so as not to shatter their fans' illusions.
AKB48's management office said Minegishi had been demoted to a trainee team as punishment "for causing a nuisance to the fans".
But author and critic Hiroki Azuma said it was "disgusting" that the star felt she should resort to a traditional act of contrition when the only rules she had broken were those of her band's.
Some fans and commentators say Minegishi went too far with her public apology, and that it was unnecessary.
"What's the point of this public execution show? It's like something from the war or a totalitarian state," one fan said on Twitter.
A Japanese pop star has shaved her head and offered a filmed apology after breaking her management firm's rules by spending a night with her boyfriend.