Ball as in a dance dates from the early 1600s and derives from the French bal or baller meaning dance or to dance. Balls meaning testicles has been in use since the 14th century and as such, is not as old as bollocks, which is another Old English word for testicles. In America, to have the balls meaning to have nerve or courage has been in use from the 1920s. Balls-up is slang for a mistake or disaster and dates from the late 19th/early20th century. To have a ball meaning to have a good time as in a ball or dance is American slang from c.1930. Also from America, ball meaning to copulate was originally Jazz slang from around 1940.