Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IDE auto generated code...

 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

-Tad
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic