aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Changing NetBeans Style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Changing NetBeans Style" Watch "Changing NetBeans Style" New topic
Author

Changing NetBeans Style

Farid Abdi
Greenhorn

Joined: Dec 25, 2012
Posts: 12

Hi
I learned Java alittle with JDK tools...Now I want to start programming with NetBeans...But there is a little problem :
The book that taught me Java used a convention like this :
ClassName
{
....
}

But my NetBeans uses this convention :
ClassName{
...
}

How I could change the setting and preferences in my NetBeans so that its convention and appearance of source code changes to my style
Thanks
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
Moving to our IDEs forum.

I rarely use NetBeans myself, so I don't know. Remember it is a convention not a rule.
Farid Abdi
Greenhorn

Joined: Dec 25, 2012
Posts: 12

What IDE you suggest ?
What IDE follows my convention ?
Thanks
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
I usually use Eclipse. You can set preferences as properties of the current project, and “export” them as a configuration file.
Maybe somebody will know how to do it in NetBeans. I found a few possible links by Googling: maybe this will help, or this. The process seems quite simple, and similar to what I am used to doing with Eclipse.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3434
    
  47

This is configurable in NetBeans. I'm using NetBeans 7.2.1, but I think the process will be very similar in other versions:

1) Chose Tools/Options from the menu
2) In the Options form, click the Editor button and choose Formatting tab
3) Choose Java in the Language combo box. Now browse individual categories in the Category combo box, there is a lot of options. The position of the braces can be configured in the Braces category.
Farid Abdi
Greenhorn

Joined: Dec 25, 2012
Posts: 12

Hi
Now I installed Eclipse....How I can change that convention in Eclipse ??? ....Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Eclipse enables you to control all aspects of coding style. Look at Windows | Preferences | Java | Code Style | Formatter. There you can tweak the formatting to your hearts content. I recommend first making a copy of an existing profile and modifying the copy.

Also, while on the Preferences dialog, look at Java | Editor | Save Actions - one of the things you can do automatically when saving is reformatting.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing NetBeans Style
 
Similar Threads
How to access private field and private method in Java
Problem with Netbeans
Changes from Java 1.5 to current Java 7 version
WA #1.....word association
So is it still Java?