0

In some of my code has suddenly changed format in that before every period and = sign a number of spaces followed by a newline character have appeared, as in the following snatch of code. This is only in a few of my java classes, and it has happened several times. Have I possibly inadvertently changed something in the formatting layout?

     int oldVel
            = jSliderVelocity
                    .getValue();

    // Get vel from txt field and set slider accordingly
    int vel
            = Integer
                    .parseInt(jTextFieldVelocity
                            .getText());

    int start
            = jSliderVelocity
                    .getMinimum();
skomisa
  • 16,436
  • 7
  • 61
  • 102

1 Answers1

0

This usually happens if you are having a syntax error in your code (e.g. missing braces) and format your code. Sadly there is no way that Netbeans corrects those linebreaks after fixing the syntax error. You have to do it manually.

Joachim Rohde
  • 5,915
  • 2
  • 29
  • 46
  • Thanks, Joachim, that is useful to know. Now you point it out, I think I might well have been reformatting with a missing brace in order to find the missing brace - what irony! I will watch out for it in future. – Dave Ellison Apr 05 '19 at 11:31