JOHANNESBURG (AP) — It's a long way from Centre Court at Wimbledon for Roger Federer, who has opened a preschool in impoverished Malawi as part of his charity work.

The tennis star traveled to Malawi to see firsthand the impact of funds from his foundation, which contributes to education programs in half a dozen countries in southern Africa. Federer, who turns 34 next month, described his philanthropic outreach as gratifying in a different way from the exultation of lifting a Grand Slam trophy.

"It's like meeting a friend you haven't seen for 20 years," Federer said in an interview with The Associated Press on Monday in an airport hotel in Johannesburg.

The No. 2-ranked Swiss player's mother is South African and he retains a South African passport. His foundation has withdrawn from operations in Ethiopia and Tanzania to focus on southern Africa. It aims to help educate 1 million children by 2018, an ambitious goal that Federer attributes partly to his drive as a tennis player.

"You can get very sentimental and sad" about extreme poverty in places such as Malawi, he said. But he remarked on the positive attitude of the children he met, even though they have limited opportunities.

Federer, who lost on July 12 to Novak Djokovic in the Wimbledon final, said he plans to start training again soon ahead of the American summer season of tournaments leading to the U.S. Open.

Reflecting on Wimbledon, he said: "After a tournament like that, you take away the good things but then you also take away the things that maybe you could have done better, because you can always do better."

Federer, who has won 17 Grand Slam titles, including seven Wimbledon titles, said he was disappointed at the loss to Djokovic. But he also said the media and others sometimes had high expectations and failed to fully recognize that reaching the final of a Grand Slam tournament was a stellar achievement.

"I think sometimes you need to adjust the mind of the people because it's actually a great result, being able to play a final or a semis for that matter," Federer said. "Thankfully, in tennis, we have a lot of highlights during the year, which make it actually easier to digest a loss like that."

As for his charity work, Federer said he would pursue it "way past my playing days in the years to come."