netbeans and code reformatter

L

lallous

Hello

1)
When I press ctrl+shift+f to reformat the code, it goes like that:

void method() {
for (...) {
}
}

I prefer to have it reformatted as:
void method()
{
for (...)
{
}
}

How can I set this up?

2)
Does netbeans editor support virtual spaces?
Like when you move the cursor freely w/o the need to have characters at
that line.
Cause the IDE will move the cursor to the last character in a line if
you scroll from a longer line to a shorter line

Regards,
Elias
 
T

Thomas Kellerer

I prefer to have it reformatted as:
void method()
{
for (...)
{
}
}

How can I set this up?
Tools -> Options -> Editor, then click on the "Indention" tab

Thomas
 
L

lallous

Hello Thomas

Can you be more specific on that option?

There's an option that reads: "Insert new line before braces", it works
but with I press ctrl+shift+f to reformat, the old identing still
applies.

Hope someone can suggest something that works.

Regards,
Elias
 
B

bugbear

Hello

1)
When I press ctrl+shift+f to reformat the code, it goes like that:

void method() {
for (...) {
}
}

I prefer to have it reformatted as:
void method()
{
for (...)
{
}
}

Whilst indenting in 'C' was matter of local
preference, habit or taste, indenting in
Java has a documented standard.
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

And (IMHO) (almost...) any standard is better
than a free for all, especially in the era
of shared and/or open source.

BugBear
 
K

Kroll, Michael

Hi,

which Version of NetBeans do you use ?
In the moment I use NetBeans 5.0 and 5.5dev (Java 1.5.0_07) and it
work's fine.
It do the thinks that do you want.

Regards
Michael
 
L

lallous

Hello Michael,

I am using 4.1, what options specifically you set so that you change
the code formatting as per the original thread?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top