You can select multiple lines of code and then indent all those lines by pressing Tab or Ctrl-T. You can reverse indentation of lines by selecting those lines and then pressing Shift-Tab or Ctrl-D.
To make Netbeans tab for 4 spaces: press "Tools" -> "Options" -> "Formatting". There should be a text field "Tab size" to set the tabbing size (see image bellow).
Clicking on CTRL + 2 will open the Files Tab.
Go to Tools-> Options-> Editor-> Formatting and uncheck Expand tabs to spaces:
Ensure you also pick coherent values for "Number of Spaces per indent" and "Tab Size".
Additionally, you can check all the items in the Language combo and make sure they all use the general setting.
You can also change it in a per-project fashion. Right click on the project icon, select Properties and review the Formatting category.
These menu items remain valid as of NetBeans 8.0.
It seems to work if you select the same value for "Number of Spaces per Indent" and "Tab Size", after unchecking the "Expand Tabs to Spaces" Option, in Tools -> Options -> Editor -> Formatting, for example:
[ ] Expand Tabs to Spaces Number of Spaces per Indent: [ 4] Tab Size: [ 4] ....
For NetBeans 7.1.2,
I needed to go to Tools -> Options -> Editor -> Expand Tabs to Spaces and uncheck that one (make sure you have "All Languages" selected). And also put an "8" for both Number of Spaces per Indent and Tab Size.
Just having the same value there does not do the trick for me. It must be 8.
In Tools-> Options-> Editor-> Formatting Expand tabs to spaces should be unchecked and Number of Spaces per Indent should be equal with Tab Size. Also check when you change Language from All languages to other there Override Global Options should be unchecked, too.
Netbeans IDE 8.2 (OSX)
Goto File -> Project Properties (Your Project)
Select Formatting in Categories:
Click on Edit global options.
Then Click on Ok
If you want set project specific then :
Then Click on Ok
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With