netbeans and code reformatter

netbeans and code reformatter

Post by lallou » Fri, 11 Aug 2006 16:38:39


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
 
 
 

netbeans and code reformatter

Post by Thomas Kel » Fri, 11 Aug 2006 16:47:12


Tools -> Options -> Editor, then click on the "Indention" tab

Thomas

 
 
 

netbeans and code reformatter

Post by lallou » Fri, 11 Aug 2006 20:45:02

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
 
 
 

netbeans and code reformatter

Post by bugbea » Fri, 11 Aug 2006 20:56:48


Whilst indenting in 'C' was matter of local
preference, habit or taste, indenting in
Java has a documented standard.
http://www.yqcomputer.com/

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

BugBear
 
 
 

netbeans and code reformatter

Post by Kroll, Mic » Fri, 11 Aug 2006 21:03:45

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

--
German Netbeans, GlassFish and Java-Forum
http://www.yqcomputer.com/
 
 
 

netbeans and code reformatter

Post by lallou » Tue, 15 Aug 2006 18:58:11

Hello Michael,

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