Search code examples
javamysqljarjframejbutton

my project runs but there are several error like lines which I need to remove


When I debug the project the debug panel shows me several lines of errors(I am not 100% sure whether these are errors or just warnings).Same time my project runs until I hit the login button.I want to know how to remove these red colored error lines and to step into the main window of my project.

Below are the error lines-:

Non-existing path "C:\Users\User\Documents\NetBeansProjects\lib\calendarfx-view-8.4.0.jar" provided.
Non-existing path "C:\Users\User\Documents\NetBeansProjects\jcalendar-1.4.jar" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.JasperReports.classpath}" provided.
Non-existing path "D:\softwares\javax.mail-1.6.0-rc1-javadoc.jar" provided.
Non-existing path "D:\softwares\javax.mail-1.6.0-rc1-sources.jar" provided.
Non-existing path "D:\softwares\javax.mail-1.6.0-rc1.jar" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.absolute_.classpath}" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.reporting.classpath}" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.reporting3.classpath}" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.reporting2.classpath}" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.jasper.classpath}" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.calendarfx.classpath}" provided.
Non-existing path "C:\Users\hp\Documents\NetBeansProjects\POST_NEW\${libs.JAVADB_DRIVER_LABEL.classpath}" provided.
Have no file for C:\Users\User\Documents\NetBeansProjects\lib\calendarfx-view-8.4.0.jar
Have no file for C:\Users\User\Documents\NetBeansProjects\jcalendar-1.4.jar
Have no file for D:\softwares\javax.mail-1.6.0-rc1-javadoc.jar
Have no file for D:\softwares\javax.mail-1.6.0-rc1-sources.jar
Have no file for D:\softwares\javax.mail-1.6.0-rc1.jar

These are coming because I added some jar files into a previous project folder or to palette or somewhere sometime ago.Now even though that folder isn't available in the NetBeans project folder these are coming.

Below is the code of login button

private void loginActionPerformed(java.awt.event.ActionEvent evt) {                                      

        if (E_ID.getText().trim().length() == 0 | PWD.getPassword() == null) {
            JOptionPane.showMessageDialog(null, "Username or Password cannot be blank", "Error", 0);
        } else {
                try {
                ResultSet rs = new DBG1().getData("select * from USER where E_ID = '" +E_ID.getText() + "'");
                Vector v = new Vector();

                if (rs.next()) {
                    v.add(rs.getString(1));
                }
                if (v.isEmpty()) {

                    JOptionPane.showMessageDialog(null, "Invalid Username or Password", "Error", 0);
                    E_ID.setText("");
                    PWD.setText("");
                    E_ID.grabFocus();

                } else {
                    ResultSet rs1 = new DBG1().getData("select * from USER where E_ID ='" + E_ID.getText() + "'");
                    while (rs1.next()) {
                        String type = (rs1.getString(3));
                        System.out.println("while");

                        if (E_ID.getText().trim().equalsIgnoreCase(rs1.getString("E_ID")) && PWD.getText().equals(rs1.getString("PWD"))&& type.equals("Admin")) {// 
                            this.dispose();
                           new Home_Page(E_ID.getText()).setVisible(true);

                        } else if (E_ID.getText().trim().equalsIgnoreCase(rs1.getString("E_ID")) && PWD.getText().equals(rs1.getString("PWD")) && type.equals("User")) {
                            this.dispose();
                           new Home_Page(E_ID.getText()).setVisible(true);

                        } 
                        else {
                            System.out.println("else");
                            JOptionPane.showMessageDialog(null, "Invalid Username or Password", "Error", 0);
                            E_ID.setText("");
                            PWD.setText("");
                            E_ID.grabFocus();
                        }
                    }
                    this.dispose();
                  }
            } catch (Exception e) {
                System.out.println(e);
            }
        }
    }

In above code it reads until while loop goes inside then compiles the else part from else-if.In here the value retrieved by "type.equals("Admin"),type.equals("User")" is false that's why it doesn't compiles the if part or the else-if part of that else-if and compiles the else part.I want to go inside the above said if part.Can any body tell me where should I amend to make the value of that part true and go inside the if part? (In "user" internal frame there is a text-field called U_LEVEL which refers to the MYSQL table USER and column U_LEVEL where I have already saved the values "Admin "and "User")


Solution

  • my project runs but there are several error like lines which I need to remove

    NetBeans IDE is simply informing you that your dependency .jar files do not exist as provided path.

    i.e May deleted or moved to another folder.

    Solution

    Create a lib folder inside your NetBeans project folder & Copy all of your .jar into lib folder, Then Goto your NetBeans project and extend it,Right click on Libraries.

    There is two way to add dependency jar to your project
    
    1. Add Library...
    2. Add JAR/Folder...

    Clean your project Then Run, You'll get no error next.