-3

I have this code:

static int kontrolaParityZavorek2(final char[] text, int zacatek) {
while (zacatek < text.length && jeOteviraciZavorka(text[zacatek])) {
int konec = kontrolaParityZavorek2(text, zacatek + 1);
if (konec >= text.length ||!jsouParove(text[zacatek], text[konec])) 
{throw new RuntimeException("Chybi uzaviraci zavorka na pozici: " + konec);}
zacatek = konec + 1;
}
return zacatek; 
}

I want to go to NetBeans, paste this code and autoindent the code in 1 second, so that it looks like this:

static int kontrolaParityZavorek2(final char[] text, int zacatek) {
  while (zacatek < text.length && jeOteviraciZavorka(text[zacatek])) {
    int konec = kontrolaParityZavorek2(text, zacatek + 1);
    if (konec >= text.length ||!jsouParove(text[zacatek], text[konec])) 
    {throw new RuntimeException("Chybi uzaviraci zavorka na pozici: " + konec);}
    zacatek = konec + 1;
  }
  return zacatek; 
}

Is it possible? If so, which key combination should I use or where in MENU can I find the function of AUTO INDENTING.

user1111261
  • 127
  • 2
  • 2
  • 5

1 Answers1

10

Use the auto-formatter.

Source -> Format

or

Alt + Shift + F

Jeroen Vannevel
  • 43,651
  • 22
  • 107
  • 170