NetBeans Modifies New Method Behavior

Suppose I have this code in Java in NetBeans

public class Clazz {

    public void method1() {
        method3(); // here is my cursor
    }

    public void method2() {

    }

}

So, I press Alt + Enter to prompt "create method", which creates my method at the end of the class.

public class Clazz {

    public void method1() {
        method3();
    }

    public void method2() {

    }

    private void method3() {
        throw new UnsupportedOperationException( "Not supported yet." );
    }

}

So my question is how to create a method only under the current method? Similar:

public class Clazz {

    public void method1() {
        method3();
    }

    private void method3() {
        throw new UnsupportedOperationException( "Not supported yet." );
    }

    public void method2() {

    }

}

Thank you for your time:)

+4
source share
1 answer

Unfortunately this is not possible. An earlier error report about the placement of the code generated by this function was rejected:

, , , - (GeneratorUtilities ClassMemberComparator).

+1

All Articles