0

just have a very big problem with my project, i work on a java project on NetBeansIDE 8.2 i'm on Windows8 x86, in netbeans GUI Builder when i changed a component variable_name to another one, the old variable_name have been stuck in the non-editable line of code, i tried search in netbeans community and searchs in web but got nothing, it occurs after i updated my JDK from(JDK 8u191) to (JDK 8u202), tried same operation on some other project and it makes them useless too (stuck code).

my question: is there is a way to fix this? or edit this non-editable lines?

it's like this cannot edit these lines contains error

password_showing is old one and cannot be deleted,

there is:

  • copy code inside event
  • delete event
  • recreate event
  • paste code inside

but it's a big project i cannot do this for every single event, is there is a way to solve this? thanks!

  • The non-editable code is non-editable for a reason. You can change all the code that is generated through the GUI editor - including renaming of variables of GUI components –  Jan 21 '19 at 21:27
  • how did you rename it? – void Jan 21 '19 at 21:28
  • It's not a duplicate of your question, but some of the comments and answers to [How to change non-editable/generated code in netbeans](https://stackoverflow.com/q/17131589/2985643) might be helpful. – skomisa Jan 22 '19 at 06:05
  • @a_horse_with_no_name i changed some setting for generated code in GUI Builder but nothing changed, it still guarded code – mhamad arsalan Jan 22 '19 at 16:32
  • @Null from right_click menu -> "Change Variable Name" – mhamad arsalan Jan 22 '19 at 16:33

1 Answers1

1

Perhaps you changed the name through Property/name, it changes the name but not the name of event methods and auto generated codes. The correct way to rename a control in netbeans is to right click on it and say rename: right click on the control -> change variable name

Update regarding your current issue:

You may fix your current issue withig *.form, *.java and *.xml related files in the project but it's not recommended and you may stuck more and face more issues!

void
  • 7,760
  • 3
  • 25
  • 43
  • actually i changed variable name by RightClick on component then "Change Variable Name", yes i fixed this like you said, corrected line inside *.java file with normal text editor and saved it, then re-open project, **maybe** it's not the best way but it works fine! thank you =) – mhamad arsalan Jan 22 '19 at 16:49