According to one embodiment, an electronic apparatus includes a device
detection unit which detects an external device which is located within a
wireless communication area that is covered by the electronic apparatus,
a distance calculation unit which calculates a distance between the
electronic apparatus and the detected external device on the basis of a
radio-wave intensity of a wireless signal which is transmitted from the
detected external device, and a connection control unit which establishes
wireless connection between the detected external device and the
electronic apparatus if the distance calculated by the distance
calculation unit is within a predetermined reference distance.