I can’t find an option in Netbeans (7) to align variables. For example, I want to change this:
private int hello = 1;
private static int hello2 = 1;
public static String hello3 = "yo";
private final static int HELLO3 = 1;
private String stringy = "testing hello";
private char c = 'a';
into this (or something similar):
private int hello = 1;
private static int hello2 = 1;
private final static int HELLO3 = 1;
private char c = 'a';
private String stringy = "testing hello";
public static String hello3 = "yo";
when I press Format (alt+shift+f).
Also, I’d like it to be applicable to local variables, so that this:
private void Test()
{
int x = 2;
String z = "test";
int[] y = {1, 2, 3};
}
would change into this:
private void Test()
{
int x = 2;
int[] y = {1, 2, 3};
String z = "test";
}
I’ve looked in Tools->Options->Editor->Language "Java"->Category "Alignment", however, I found nothing that affects this.
You can use the Jindent plugin for Netbeans. But there is a caveat: it is a limited evaluation version. You have to pay for the full version.