Maintain indenting like in an IDE

108 Views Asked by At

Now that I know how to highlight syntax in EditText, I would like to as how I can maintain auto-indenting like Notepad++ or Eclipse. For eg:

public class Main{
    public static void main(String[] args){
        System.out.println("Hello, World!");
        System.out.println("Hello, again!");
    }
}  

How do IDEs know how much space to add such that my second System.out.println() is right underneath the first ?

1

There are 1 best solutions below

1
On

Eclipse can auto-indent on demand. To do this, select a desired code piece, then press Ctrl+I ("Fix indentation").