File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes IDE auto generated code... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "IDE auto generated code..." Watch "IDE auto generated code..." New topic

IDE auto generated code...

Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Is there a way to change (In Eclipse and Netbeans, using/playing with both at the moment) to change the way the autogenerated code is formatted?

I really dislike having the { at the end of the line and not the start of a new line. I know the different styles have names (can't think of them off the top of my head) but is there an easy way to switch the style used by the ide?

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

In Eclipse look at Preferences>Java>Code Style>Code Formatter. Set the style you like there and format classes via Source>Format or CTRL+SHIFT+F. Don't know about NetBeans, sorry.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

The original Eclipse formatter was (IMHO) pretty awful. More recent ones do better, but I like the Jalopy plugin, which comes about as close to being able to format things exactly the way I like as mindless software can get.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: IDE auto generated code...
jQuery in Action, 3rd edition