Barrie wrote his first novel, Better Dead, in 1887, and then several novels set in Scotland. In 1890, he began to write plays and that same year he met the five Llewelyn Davies brothers who were the inspiration for Peter Pan. When the boys’ parents died, Barrie became their guardian.
Barrie wrote mostly plays after Peter Pan and he died on June 19, 1937 in London, England.
Information from: http://www.biography.com/people/jm-barrie-9200058.