Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-6339

Formatting and indentation options for Java in NetBeans 12.6 are broken



    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 12.6
    • 11.3, 12.0.1
    • None
    • None
    • Xubuntu 20.04 LTS, JDK 1.8


      Recently switched to NetBeans 12.6 from 11.3, and observed this annoying bug, which I have tried to track down a bit now. It occurs in 12.6, but not in 11.3 or 12.0.

      In NetBeans 12.6, the formatting settings for Java language under Tools->Options->Editor->Formatting do not work anymore. This bug can be observed due to several symptoms:

      1) In the options menu, the "code preview" on the right side does not work anymore. As seen in the screenshots below, on the right side (NB 12.0, same in 11.3), one can see how the code would look. On the left side (NB 12.6) it is blank.


      2) Furthermore, in NB 12.6, it is impossible to deselect the "Use All Languages Settings" check box under Java language. While I can remove the checkmark, when pressing "OK" or "Apply", the setting will not be saved, and the checkmark will return.

      3) The indentation feature itself is a bit broken due to this. For example in an empty line, it is impossible to add a Tab. For example, in the screenshot below, I would like to indent the code inside of testClass. If I press Tab, nothing happens. Only if I add a space or another character, then I am able to add a Tab in front of it. 

      4) Indentation can be disabled for All Languages (though this is quite an important feature which I'd not like to disable completely!). However, if I try to re-enable it, it will not automatically apply the new settings for Java language. Only when I select "Java" as the language, disable "Use all languages setting" and reenable it, then the behaviour from All Languages will be applied.


        1. nb 12.0 options menu.png
          97 kB
          Marco Dyga
        2. nb 12.6 options.png
          72 kB
          Marco Dyga
        3. Screenshot_2021-12-28_12-31-43.png
          44 kB
          Marco Dyga

        Issue Links



              Unassigned Unassigned
              mdyga Marco Dyga
              0 Vote for this issue
              2 Start watching this issue