To enable line numbers in the editor's gutter we have to go to Tools | Options | Advanced options. We must select Options | Editing | Editor Settings. And here we can enable the Line Numbers property.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZMvEFUu1n7xUGF9ZkjNiKPr3SpY4EjgVnlqXJjcZJROsHHM73NQHUl2_7e9gl3rrYK0Ga6uRvSrHz7pQc94OvBaBVzi_nG_RWMfao3kCsvDTZFNsqKV9dCvw-XtpXdfQ_nvdlSEhcGIjq/s320/netbeans-linenumbers.png)
or
In NetBeans go to View and select Show Line Numbers.