To install a Brother HL-2240 printer on Ubuntu 16.04, download the Driver Install Tool.
Unpack the Driver Install Tool and begin the installation with these two commands:
$ gunzip linux-brprinter-installer-2.0.0-1.gz
$ sudo bash linux-brprinter-installer-2.0.0-1
When it says "Input model name" enter "HL-2240DW" (without quotation marks).
Input model name ->HL-2240DW
You are going to install following packages.
hl2240dlpr-2.1.1-1.i386.deb
cupswrapperHL2240D-2.0.4-2.i386.deb
OK? [y/N] ->y
When it asks "Will you specify the Device URI? [Y/n] ->" answer "n" if you will use it via an USB cable.
Print a test page to verify that your printer is now installed.