使用 Netbeans 表单时的通用 "Link Error"

Generic "Link Error" while working with Netbeans forms

我继承了一个 NetBeans 项目,我也必须进行一些更改。我在 NetBeans 方面没有太多经验,而且我对该应用程序有疑问。该应用程序基本上是一个考勤系统,使用 MySQL 来存储和检索数据。我的问题来自初始登录表单 Login.java 。我能够通过从 MySQL 检索到的凭据成功登录。但是,成功登录后,我在输出 window 中收到一个通用的“Link Error”,没有进一步的解释。这是说明无法加载下一个表单的一般错误吗?我对实际问题是什么感到有点困惑。成功登录后,Login.java 应加载 Admin_main.java,这是第二种形式。谁能阐明这里可能出了什么问题?我真的很感激任何帮助!这个错误对我来说没有任何意义。提前致谢!

更新 -- 这是相关代码。每当此表单运行时,它都会生成 link 错误。没有更多的信息,不少。这是一个非常基本的形式。我只是不明白。

import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;


public class stink_belt extends javax.swing.JFrame {

    /**
     * Creates new form stink_belt
     */
    String adminid=null;
    CardLayout card=new CardLayout();
    skunk_ditch st=null;
    stink_cell sub=null;
    flush_rocket fac=null;
    riggity_ras dept=null;
    man_child user=null;
    rocket_tail schedual=null;
    Knocker_knot webcam=null;
    PeeTomSue rptgn=null;
    public stink_belt() {
        initComponents();

        panel_main.setLayout(card);
        st=new skunk_ditch();
        sub=new stink_cell();
        fac=new flush_rocket();
        dept=new riggity_ras();
        user=new man_child();
        schedual=new rocket_tail(); 
        webcam=new Knocker_knot();
        rptgn=new PeeTomSue();

        panel_main.add(webcam,"Knocker_knot");
        panel_main.add(rptgn,"PeeTomSue");
        panel_main.add(st,"skunk_ditch");
        panel_main.add(dept,"riggity_ras");
        panel_main.add(fac,"flush_rocket");
        panel_main.add(sub,"stink_cell");
        panel_main.add(user,"man_child");
        panel_main.add(schedual,"rocket_tail");
        //new mainserver();

    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        panel_main = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        dbmgmt = new javax.swing.JMenu();
        studentmgmt = new javax.swing.JMenuItem();
        submgmt = new javax.swing.JMenuItem();
        facultymgmt = new javax.swing.JMenuItem();
        deparmentmgmt = new javax.swing.JMenuItem();
        usermanagement = new javax.swing.JMenuItem();
        schedualmanagement = new javax.swing.JMenuItem();
        webcams = new javax.swing.JMenu();
        allwebcams = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        aggregate_att = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Welcome");
        setName("stink_belt"); // NOI18N
        setPreferredSize(new java.awt.Dimension(930, 525));
        addWindowFocusListener(new java.awt.event.WindowFocusListener() {
            public void windowGainedFocus(java.awt.event.WindowEvent evt) {
                formWindowGainedFocus(evt);
            }
            public void windowLostFocus(java.awt.event.WindowEvent evt) {
            }
        });
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        panel_main.setPreferredSize(new java.awt.Dimension(930, 504));

        javax.swing.GroupLayout panel_mainLayout = new javax.swing.GroupLayout(panel_main);
        panel_main.setLayout(panel_mainLayout);
        panel_mainLayout.setHorizontalGroup(
            panel_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 930, Short.MAX_VALUE)
        );
        panel_mainLayout.setVerticalGroup(
            panel_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 504, Short.MAX_VALUE)
        );

        dbmgmt.setText("Rocket Management");

        studentmgmt.setText("Leper Management");
        studentmgmt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentmgmtActionPerformed(evt);
            }
        });
        dbmgmt.add(kittymgmt);

        submgmt.setText("Subject Management");
        submgmt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                submgmtActionPerformed(evt);
            }
        });
        dbmgmt.add(rotmgmt);

        facultymgmt.setText("Faculty Management");
        facultymgmt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                facultymgmtActionPerformed(evt);
            }
        });
        dbmgmt.add(stinkmgmt);

        deparmentmgmt.setText("Department Management");
        deparmentmgmt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deparmentmgmtActionPerformed(evt);
            }
        });
        dbmgmt.add(deparmentmgmt);

        usermanagement.setText("User Management");
        usermanagement.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                usermanagementActionPerformed(evt);
            }
        });
        dbmgmt.add(usermanagement);

        schedualmanagement.setText("Calendar Management");
        schedualmanagement.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                schedualmanagementActionPerformed(evt);
            }
        });
        dbmgmt.add(schedualmanagement);

        jMenuBar1.add(dbmgmt);

        webcams.setText("Knockers");

        allwebcams.setText("All Webcams");
        allwebcams.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                allwebcamsActionPerformed(evt);
            }
        });
        webcams.add(allwebcams);

        jMenuBar1.add(webcams);

        jMenu1.setText("Report Generation");

        aggregate_att.setText("Aggregate stink");
        aggregate_att.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aggregate_attActionPerformed(evt);
            }
        });
        jMenu1.add(aggregate_att);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Change Password");
        jMenu2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jMenu2.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jMenu2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenu2MouseClicked(evt);
            }
        });
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel_main, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel_main, javax.swing.GroupLayout.DEFAULT_SIZE, 503, Short.MAX_VALUE)
        );

        panel_main.getAccessibleContext().setAccessibleName("");
        panel_main.getAccessibleContext().setAccessibleDescription("");

        getAccessibleContext().setAccessibleName("stink_belt");

        pack();
    }// </editor-fold>                        

    private void studentmgmtActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
        card.show(panel_main,"skunk_ditch");
        panel_main.setSize(st.getPreferredSize());
        this.setSize(panel_main.getSize().width+20,panel_main.getSize().height+60);
    }                                           

    private void submgmtActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        card.show(panel_main,"stink_cell");
        panel_main.setSize(sub.getPreferredSize());
        this.setSize(panel_main.getSize().width+20,panel_main.getSize().height+60);
    }                                       

    private void formWindowOpened(java.awt.event.WindowEvent evt) {                                  
        // TODO add your handling code here:
        this.setLocationRelativeTo(null);
        card.show(panel_main,"Knocker_knot");
        panel_main.setSize(webcam.getPreferredSize());
        this.setSize(this.getMaximumSize().width,this.getMaximumSize().height);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
        this.getContentPane().setBackground(Color.WHITE);
        SwingUtilities.updateComponentTreeUI(this);
    }                                 

    private void facultymgmtActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
        card.show(panel_main,"flush_rocket");
        panel_main.setSize(fac.getPreferredSize());
        this.setSize(panel_main.getSize().width+20,panel_main.getSize().height+60);
    }                                           

    private void deparmentmgmtActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
        card.show(panel_main,"riggity_ras");
        panel_main.setSize(dept.getPreferredSize());
        this.setSize(panel_main.getSize().width+50,panel_main.getSize().height+60);
    }                                             

    private void usermanagementActionPerformed(java.awt.event.ActionEvent evt) {                                               
        // TODO add your handling code here:
        card.show(panel_main,"man_child");
        panel_main.setSize(user.getPreferredSize());
        this.setSize(panel_main.getSize().width+70,panel_main.getSize().height+60);
    }                                              

    private void schedualmanagementActionPerformed(java.awt.event.ActionEvent evt) {                                                   
        // TODO add your handling code here:
        card.show(panel_main,"rocket_tail");
        panel_main.setSize(schedual.getPreferredSize());
        this.setSize(panel_main.getSize().width+30,panel_main.getSize().height+60);
    }                                                  

    private void allwebcamsActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
        card.show(panel_main,"Knocker_knot");
        panel_main.setSize(webcam.getSize());
        this.setSize(panel_main.getSize().width+30,panel_main.getSize().height+60);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
    }                                          

    private void formWindowGainedFocus(java.awt.event.WindowEvent evt) {                                       
        // TODO add your handling code here:    

    }                                      

    private void aggregate_attActionPerformed(java.awt.event.ActionEvent evt) {                                              
        // TODO add your handling code here:
        card.show(panel_main,"PeeTomSue");
        panel_main.setSize(rptgn.getPreferredSize());
        this.setSize(this.getMaximumSize().width,this.getMaximumSize().height);
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
    }                                             

    private void jMenu2MouseClicked(java.awt.event.MouseEvent evt) {                                    
        // TODO add your handling code here:
        ChangePassword cp=new ChangePassword();
        cp.txt_userid.setText(adminid);
        cp.setVisible(true);
    }                                   

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(stink_belt.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new stink_belt().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JMenuItem aggregate_att;
    private javax.swing.JMenuItem allwebcams;
    private javax.swing.JMenu dbmgmt;
    private javax.swing.JMenuItem deparmentmgmt;
    private javax.swing.JMenuItem facultymgmt;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel panel_main;
    private javax.swing.JMenuItem schedualmanagement;
    private javax.swing.JMenuItem studentmgmt;
    private javax.swing.JMenuItem submgmt;
    private javax.swing.JMenuItem usermanagement;
    private javax.swing.JMenu webcams;

这里是NetBeans出错后的截图。 link 错误实际上引用了 run.xml,例如 94 和 111。不过我无法识别其中的任何内容。

我没有发现任何本质上的错误。

既然你说这是一个继承的项目,而且你得到一个 link 错误,我想知道你的库是否已过时或位置错误。

我终于找到了导致问题的答案。我正在使用人脸识别 sdk,出于某种原因,Netbeans 没有在类路径、库或其他任何地方看到它,即使它是明确定义的并且物理上存在。我感谢大家在这个问题上的帮助。很难确定。它没有完全解决,但这部分是。我感谢大家的帮助。我喜欢这个网站。