Reputation: 2191
I am using Netbeans 8.0.2 IDE for a java swing application development. When I add a control to a jframe it gets a name with a default initialization manner. But I want to change the name of the control.
In the property list there is something called name, I changed it, But It was not successful. Again when i add an action, it takes the previous name. In coding section I can see this generated name but it is not able to modify. I want to know. How I should change the control name property using Netbeans.
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
Ex:- I want to change this jButton1 in to a custom name (say btnOk) using Netbeans design mode.
Upvotes: 2
Views: 4390
Reputation: 2989
try doing this
right click on the button >- change variable name >- your custom name
Upvotes: 2