Fixing NetBeans 6.9 else Indentation

It’s annoying when IDE didn’t make coding process easier. For this case is NetBeans 6.9, this netbeans version annoy me when i type “else” word. After typing “else”, the word become at the most left of the editor (without indentation) like code below. What’s wrong, NetBeans 6.8 still okay with this case.

public class Class {

    public void method()
    {

        if (foo)
        {
            doSomething();
        }
 else
        {
            doSomethingElse();
        }
    }

}

I don’t know this is bug or what but the solution to fix this problem is :

  1. Open Tools -> Options
  2. Choose Editor menu
  3. Choose Formatting tab
  4. Set the combo box languages to “Java”
  5. Set the combo box category to “alignment”
  6. Check the “else” New Lines

One Thought on “Fixing NetBeans 6.9 else Indentation

  1. ahh, you’ve found the solution..
    i was very annoyed with this indentation thing -___-‘
    thx :-p

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation