The Blackhawks announced the deal late Friday night. Campbell, who had to agree to waive his no-trade clause, has five years left on his contract paying him $7.14 million a season.
Olesz has three more years on his deal with a cap hit of $3.125 million.
Campbell had refused to waive the no-trade clause as recently as Thursday night, a source told ESPNChicago.com's Jesse Rogers earlier on Friday.
Campbell was a Blackhawks-best plus-28 this past season, which placed him eleventh in the league in that category. Campbell had five goals and 22 assists in 65 games in 2011-11.
Olesz had six goals and 11 assists in 44 games for the Panthers last season.
Pierre LeBrun covers hockey for ESPN.com. Information from ESPNChicago.com's Jesse Rogers was used in this report.