The Simpsons parody of Rear Window

"Bart of Darkness," broadcast in 1994 as part of The Simpsons sixth season, features a parody of Rear Window, including James Stewart in the apartment.