NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Code indentation in netbeans

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
csenthilkumar87



Joined: 30 Mar 2009
Posts: 2

PostPosted: Mon Mar 30, 2009 12:34 pm    Post subject: Code indentation in netbeans Reply with quote

Hi.. I am finding it difficult to tell netbeans to indent code the way I want.

Product Version: NetBeans IDE 6.5 (Build 200811100001)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22


Take the following code -

void myfunction()
{
// do something
}

I have the practice of indenting the curly braces like shown above.

When I insert lots of code, things get messed up and I hit ALT+SHIFT+F to properly indent the code. But it comes like this -

void myfunction() {
// do something
}

I am not used to writing like that and it is driving me crazy. Can someone tell me how to tell netbeans to indent like the first method when I hit ALT+SHIFT+F ?? Or is there another key combination that will do it?

This kind of indentation, that I am not used, to is very irritating. Please tell me how to make it indent the other way.

Thanks..
Back to top
Jiri Prox
Posted via mailing list.





PostPosted: Mon Mar 30, 2009 1:22 pm    Post subject: Code indentation in netbeans Reply with quote

Hi,

you can customize the indentation in options dialog. Go to Tools ->
Options -> Editor -> Formatting and set preferred values. For example
your problem can be set in language Java, Category Braces by setting
Braces Placing to new line.

Regards
Jirka

csenthilkumar87 wrote:
Quote:
Hi.. take the following code -



void myfunction()

{

// do something

}



I have the practice of indenting the curly braces like shown above.



When I insert lots of code, things get messed up and I hit ALT+SHIFT+F to properly indent the code. But it comes like this -



void myfunction() {

// do something

}



I am not used to writing like that and it is driving me crazy. Can someone tell me how to tell netbeans to indent like the first method when I hit ALT+SHIFT+F ?? Or is there another key combination that will do it?



This kind of indentation that I am not used to is very irritating. Please tell me how to make it indent the other way.



Thanks..




Back to top
csenthilkumar87



Joined: 30 Mar 2009
Posts: 2

PostPosted: Mon Mar 30, 2009 1:51 pm    Post subject: Reply with quote

Hi.. thanks for the reply.

I tried setting the options you mentioned. But they work only for .JAVA files. Thanks. Smile

But I am working with JSP code. They contain JAVA code too right? It doesn't work for them. Sad How do I make it work for JSP files? Question

I am relatively new to using NetBeans so please don't be pissed off if I ask really silly questions.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo