William Shakespeare wrote the comedy Love's Labour's Lost in the mid-1590s. It was first published in 1598.
The noblemen, Berowne, Dumaine, and Longaville, vow to devote themselves to three years of study, promising not to give in to the company of women. When the princess and her three ladies visit the kingdom the men instantly and comically fall in love with them.