StKiller
StKiller

Reputation: 7951

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 ?

Upvotes: 2

Views: 6861

Answers (3)

Eko Setiawan
Eko Setiawan

Reputation: 230

This macro work to me:

Shortcut: Shift + {

Macro code: "}" caret-backward

Upvotes: 0

Majo
Majo

Reputation: 11

I looked for solution too, for NetBeans 8.5 check answer, https://stackoverflow.com/a/38338967/7162006, in same window is option: Completition Selectors For Java add: {, autocomplete by hiting enter in editor. (classically)

Upvotes: 1

d1e
d1e

Reputation: 6442

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.

Upvotes: 4

Related Questions