How to modify/add code to the initComponents() method in Java using NetBeans?

前端 未结 8 1428
情书的邮戳
情书的邮戳 2020-12-05 18:59

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 high

8条回答
  •  [愿得一人]
    2020-12-05 19:15

    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() {
    }
    

提交回复
热议问题