How to modify/add code to the initComponents()
method in Java on NetBeans? When I try to add any line of code this area seems to be like readonly and it's highlighted in gray! It's for security probably, but I suppose there is a way to disable that.
Yes the initComponents method is read only to keep full control for the IDE. You may add yours in the constructor right after initComponents.
public class NewJFrame extends javax.swing.JFrame {
/** Creates new form NewJFrame */
public NewJFrame() {
initComponents();
myInitComponents();
}
public void myInitComponents() {
}