4

When I add components or anything that automatically generates comments in NetBeans (7.1.2), the comments come out with one word per line. Like this:

    /*
   * If
   * Nimbus
   * (introduced
   * in
   * Java
   * SE
   * 6)
   * is
   * not
   * available,
   * stay
   * with
   * the
   * default
   * look
   * and
   * feel.
   * For
   * details
   * see
   * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
   */

Really??? This is just silly. This happens no matter what the source of the auto-generated comments is. I have looked through the options and settings, but I haven't found a way to fix this (unless I'm blind as a bat, in which case I apologize in advance). If all auto-generated comments are going to look like this, I'm going to have ridiculously long source code, or have to fix it manually, or have constantly to waste time deleting these long wastes of space. Anyone know of a way to resolve this?

Thanks.

Ondrej Peterka
  • 3,349
  • 4
  • 35
  • 49
Phil Bair
  • 241
  • 2
  • 4

2 Answers2

2

Had the same issue and finally figured it out. There's an option under Tools -> Options -> Editor -> Formatting to fix this. Set "Language" to Java and "Category" to Comments. Under the "General" section, uncheck "Wrap Text at Right Margin."

And that fixes it. I assume this is a bug of some sort, but until it gets fixed this seems to work.

1

There are bug reports for things similar to this, for example: http://netbeans.org/bugzilla/show_bug.cgi?format=multiple&id=203719

Let's just wait for a fix. Patience.

Paul-Sebastian Manole
  • 2,538
  • 1
  • 32
  • 33