John Bernard "J. B." Brooks is the central character in the 1976 film The Shootist. At the beginning of the film, he learns from a trusted friend, Dr. E. W. "Doc" Hostetler (played by James Stewart) that he has cancer.
He spends most the rest of the film getting his affairs in order and suffering the cold looks from the town members after a long life of rough living. He sets it up with three local bad men to meet him on his 58th birthday to die with a gun in his hand rather than by cancer.