MIAMI -- Dwyane Wade and LeBron James were only a few miles away from Trayvon Martin on Feb. 26, participating in the NBA All-Star Game on the night the unarmed black teenager wearing a hooded sweatshirt was shot to death by a neighborhood crime-watch volunteer.

They never knew the teenager, but on Friday they decided it was time to speak out.

Wade posted a photo of himself from a previous photo shoot wearing a hooded sweatshirt, otherwise known as a hoodie, to his Twitter and Facebook pages on Friday morning.

A couple hours later, James posted another photo -- this one of the Heat team, all wearing hoodies, their heads bowed, their hands stuffed into their pockets.

The photo was taken at the team hotel, and Heat coach Erik Spoelstra called it "a powerful move."

Among the hashtags James linked to the photo: "WeWantJustice."

"As a father, this hits home," said Wade, who has 10- and 4-year-old sons.

Martin was killed in Sanford, Fla., as he was returning to a gated community, carrying candy and iced tea. A neighborhood crime-watch volunteer, George Zimmerman, said he acted in self-defense and has not been arrested, though state and federal authorities are investigating.

"It really is a tragic story," Spoelstra said. "And the more you learn about it, the more confused you get."

The Heat released a statement, saying: "Our hearts go out to the family and loved ones of Trayvon Martin for their loss and for everyone involved in this terrible tragedy.

"We support our players and join them in hoping that their images and our logo can be part of the national dialogue and can help in our nation's healing."

Protests have popped up nationwide in recent days, with thousands of people -- many of them wearing hoodies -- calling for action.

James told confidants that when Wade's girlfriend, Gabrielle Union, called Wade's and James' attention to the issue, the two NBA stars spent several days talking about the case, gathering information and deciding how to make a statement.

According to his confidants, James and Wade decided a team-wide message would make a stronger statement and organized the photo taken at the team's hotel in Detroit. Mike Miller, the team's only white player, was not in the photo because he was not with the team on its road trip because of injury.

LeBron James posted this team photo on his Twitter page with the hashtag #WeAreTrayvonMartin. Courtesy LeBron James

"This situation hit home for me because last Christmas, all my oldest son wanted as a gift was hoodies," Wade told The Associated Press Friday from Auburn Hills, Mich., where the Heat were to play the Detroit Pistons. "So when I heard about this a week ago, I thought of my sons. I'm speaking up because I feel it's necessary that we get past the stereotype of young, black men and especially with our youth."

Several Heat players, including Wade and James, took the floor Friday night with messages such as "RIP Trayvon Martin" and "We want justice" scrawled on their sneakers.

"I couldn't imagine if my son went to a store just to get some Skittles and a pop or iced tea and they didn't come home," Heat forward Udonis Haslem said. "We've been following the story, individually, very closely. It's just unfortunate. We just feel like something needed to be done about it. It's only right. It's only fair. ... I think it's at least a start in the right direction."

Other tributes were going on in NBA arenas on Friday night. Carmelo Anthony tweeted a photo of himself in a gray hoodie, with the words "I am Trayvon Martin!!!!!" over the picture, and his New York Knicks' teammate Amare Stoudemire -- a central Florida native -- arrived for his team's game in Toronto wearing a hooded sweater. Stoudemire also wore a gray hoodie while working out long before tipoff.

Wade also has been retweeting comments from CNN's Roland Martin on the case.

"You don't think your voice matter? 1,354,645 have signed the change.org petition demanding justice for Trayvon Martin," said one of Roland Martin's tweets, which Wade retweeted. "But the Trayvon Martin case is NOT over. Keep pushing. Keep prodding. Keep planning. Keep protesting. Justice is not an overnight thing!"

Miami-area high school students have held walkouts in protest, calling for justice for Trayvon Martin. Gov. Rick Scott appointed a special prosecutor in the case and established a statewide task force to study the law.

President Barack Obama spoke out on the case Friday, calling it a "tragedy."

"If I had a son, he'd look like Trayvon. I think they are right to expect that all of us as Americans are going to take this with the seriousness it deserves and we're going to get to the bottom of exactly what happened," Obama said.

Earlier Friday, Fox News Channel commentator Geraldo Rivera said on "Fox & Friends" the hoodie Martin wore when he was killed was as much responsible for his death as the man who shot him. Rivera later said his comment was "politically incorrect."

Separately, a Florida state lawmaker, Rep. Alan Williams, a Democrat from Tallahassee, urged the Heat stars and other NBA players in an early Friday post on Twitter to wear hoodies during pregame warmups to call attention to the Martin story.

Such a move would not be permitted under the NBA's uniform policy, though the tributes such as messages on sneakers are allowed.

"When you see Trayvon, when you see that image, he could be anybody's kid, black or white, Hispanic, Asian, what have you," Williams said in a telephone interview. "Basketball is a sport that kind of transcends race and class and all those things that divide us. For me, as a state representative, we have to go beyond the traditional routes that some people would take."

The NBPA called not only for Zimmerman's "prompt arrest," but a review of the Sanford Police Department.

"Their silence in the face of this injustice is reprehensible and they cannot be trusted to safeguard the citizens of the Sanford community equally," the NBPA said. "The NBPA seeks to ensure that Trayvon Martin's murder not go unpunished and the elimination of the injustices suffered by the innocent."

Information from ESPN.com NBA reporter Brian Windhorst and The Associated Press was used in this report.