3

私は NetBeans プロジェクトを継承しましたが、これにも変更を加える必要があります。私は NetBeans の経験があまりなく、アプリケーションに問題があります。このアプリは基本的に、MySQL を使用してデータを保存および取得する出席システムです。私の問題は、Login.javaである初期ログインフォームから発生します。MySQL から取得した資格情報を介して正常にログインできます。しかし、ログインに成功すると、出力ウィンドウに一般的な「リンク エラー」が表示されますが、それ以上の説明はありません。これは、次のフォームをロードできなかったことを示す一般的なエラーですか? 実際の問題が何であるかについて、私は少し困惑しています。ログインが成功すると、Login.javaはAdmin_main.javaをロードする必要があります。これが 2 番目の形式です。ここで何が間違っているのか、誰かが光を当てることができますか? 助けていただければ幸いです!! エラーは私には意味がありません。よろしくお願いします!

更新 - 関連するコードは次のとおりです。このフォームが実行されるたびに、リンク エラーが生成されます。これ以上の情報はありません。かなり基本的な形です。私はそれを理解していません。

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 のスクリーンショットを次に示します。リンク エラーは、実際には 94 や 111 などの run.xml を参照しています。

Java リンク エラー

4

2 に答える 2