Search code examples
netbeansformatting

NetBeans curly braces auto-closing


In the last time I often initialize arrays in this form :

int[] test = new int[]{1,2,3};

When I type '[', NetBeans immediately put the closing brace.

The question is - which is the macro to do the same job with curly braces ?


Solution

  • Select from menu Tools > Options, select Editor in toolbar, go for Code Completion tab. You will see that Insert Closing Brackets Automatically is already automatically checked by default.

    There was a guy, who asked an analogical question a while ago. There was no helpful answer. I guess that means that we should look for that in future versions.