- This topic has 4 replies, 3 voices, and was last updated 18 years, 1 month ago by Luc.
-
AuthorPosts
-
RichlyParticipantWhen I add code for an event, e.g., ActionPerformed, from the Properties|Events, I click on <none> in the appropriate line, and then as soon as I press Enter, the source editor bounces around for a while (entertaining to watch…the first few times), highlights the new, automatically generated code and then scrolls to the bottom of the file, so I have to scroll up to find the highlighted code.
If I then decide to remove the code, I go back to the Properties|Events page, click on the … on the ActionPerformed line, and select Remove from the form that pops up. Most — but not all — of the generated code will be removed. The remaining code, e.g.,
private void jButton1ActionPerformed(
generates a couple of errors when the class is saved. The same thing happens if I simply remove the name from the line by backspacing or clicking and pressing delete, i.e., without bringing up the form.Best regards,
Richard
Riyad KallaMemberRichard,
Thank you for the detailed report, I was able to reproduce the problems right away.
RichlyParticipantMore in the same area: put a button onto a form, say jButton1, and click to add an ActionPerformed. Then change the name of the button to okButton. The result is not pretty! Go back to the Properties|Events. The name of the handler hasn’t changed, but click on the ActionPerformed’s …, and on the pop-up you will see that the name of the handler has changed, so click OK. Then look at the source code: you’ll see that jButton1ActionPerformed is still there, but there is now an error “The method okButtotnActionPerformed(ActionEvent) is undefined for the type new ActionListener(){}”.
Best regards,
Richard
RichlyParticipantP.S. Then delete the button from the form. You’d expect its handlers to go away, too. They don’t.
LucMemberThe problems appears when some option of the Java code formatter are set. It appears the critical option is the one managing the position of the the opening brace for a method declaration.
A workaround is to use the default formatter settings, or at least set ‘constructor declaration’ to ‘Same line’ in the Brace tab. -
AuthorPosts