The clubs announced the deal Wednesday.
Sgarbossa had two assists in nine games with the Ducks after starting the season in the AHL. He has three points in 29 career NHL games with Anaheim and Colorado.
Shaw has five goals and two assists in 53 games with the Panthers. He spent most of the previous three seasons in the AHL, but appeared in three playoff games for Florida last spring.
Shaw is a former third-round pick by Florida, while the Ducks acquired Sgarbossa from the Avalanche in March 2015.