Prince William met with some of those who had fled the war with Russia while in Warsaw on the second day of his surprise trip to the country.
He said: "It's amazing how resilient you are. That shines out."
The heir to the throne also met the Polish President Andrzej Duda to lay a wreath commemorating the nation's war dead.
During a visit to a food hall in Warsaw, the prince speaking to Ukrainians who have fled their home said: "It must be very difficult to start an entire new life in a new country."
The prince also thanked people who have hosted refugees.
Prince William's visit to Poland is at the request of the UK government, but the prince has previously been clear about his support for the people of Ukraine, tweeting his backing days after Russia's invasion.
His trip to Poland marks him renewing that support.
Earlier, the prince met President Duda at the Presidential Palace where they discussed the war in Ukraine and laid a wreath at a monument to soldiers.
A spokesperson for the prince said he discussed the need for ongoing support to Ukraine and its people, as well as him looking forward to the Polish head of state's attendance at the King's coronation.
On Wednesday, Prince William made a surprise trip to visit British troops in Rzeszow in south-east Poland - roughly an hour from the Ukrainian border.
He thanked British troops based in the city helping to deliver aid to Ukraine for "defending our freedoms" by "keeping an eye on" the situation in the neighbouring country.
The trip is the prince's first to Poland since a visit in 2017 with his wife Catherine.
Last May, before he was king, King Charles III travelled to Romania to meet Ukrainian refugees - the first visit from a senior royal to the region since the start of the Russian invasion of Ukraine in February last year.
Poland is a strong ally of neighbouring Ukraine and one of its largest suppliers of military equipment.
It recently pledged to supply Ukraine with fighter jets.