To caveat that ‘set in’, the story of Amleth which Hamlet is based on is set in Jutland, not on the island of Zealand where Copenhagen and Helsingør are, while Kronborg was a very new castle when Hamlet was written, having been built within Shakespeare’s lifetime.