A father-of-one accused of kicking and breaking a Luas window while irate on a phone call was threatened with contempt of court when he answered his mobile as he stood in the dock.
Ross Behan (23) is alleged to have caused the damage when he took his "rage" out on the window as he sat in a tram carriage.
He was spared custody for contempt when he apologised to Judge Grainne Malone for taking a call on his phone as she dealt with his case.
He also said he was sorry for hiccupping in court.
Judge Malone adjourned the case for Mr Behan to decide how he intends to plead.
The accused, from Benmadigan Road, Drimnagh, is charged with causing criminal damage to the tram at the Drimnagh Red Line stop on April 24 last.
The court heard it was alleged Mr Behan was on a Luas carriage when he kicked the window, which cracked and had to be replaced.
A garda said it was not alleged the accused was intoxicated, but he was on the phone to someone and got irate and "took out his rage on the window".
Judge Malone asked if anyone else was present, and the garda said there was no one else in the carriage but two people had just got off the tram.
The accused's phone then rang as he stood in the dock and he proceeded to answer it.
The judge told defence barrister Garrett Casey she wanted to hear why Mr Behan should not be held in contempt and held in custody overnight.
"Clearly he doesn't know how to behave himself," she said.
"I do apologise for answering the mobile phone," Mr Behan said. "I shouldn't have done it, I wasn't thinking. I just took it out to answer it. There's no reason my phone should be on loud in court. I apologise for hiccupping too."
Mr Casey said the accused had a sick child in hospital and he was concerned. The judge felt this was "at odds" with what Mr Behan himself said.
The judge did not place the accused in custody because he had apologised.
She accepted jurisdiction to deal with the criminal damage charge and adjourned the case.