Almost total fiction
In late 19th century Texas there was a guy named Roy Bean who functioned as a judge, admired Lillie Langtry, and had a building that closely resembled the one in the movie. Other than that, everything in this film is made up.
That being said, it is a very entertaining movie.