The clubs announced the deal on 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 in the spring.
Shaw is a former third-round pick of the Panthers, while the Ducks acquired Sgarbossa from the Avalanche in March 2015.