當我調試項目調試面板顯示我幾行錯誤(我不是100%確定這些是錯誤還是隻是警告)。同時我的項目一直運行,直到我點擊登錄按鈕。我想知道如何刪除這些紅色的錯誤行,並進入我的項目的主窗口。我的項目運行,但有像我需要刪除的行幾個錯誤
下面是錯誤線 - :
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
這些來,因爲我加了一些jar文件到以前的項目文件夾或選項板或某個地方ago.Now即使該文件夾不在可用NetBeans項目文件夾即將到來。
下面是登錄按鈕
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);
}
}
}
在上述碼的碼讀取直到while循環進入內部然後編譯else部分從else-if.In這裏由檢索到的值「type.equals(」 ),type.equals(「User」)「是錯誤的,這就是爲什麼它不編譯if部分或其他部分 - 如果編譯else部分。我想進入上面說的如果是part.Can任何機構告訴我應該在哪裏修改,以使該部分的價值真實並進入if部分? (在「用戶」內部框架中有一個名爲U_LEVEL的文本字段,它指的是MYSQL表USER和列U_LEVEL,其中我已經保存了值「Admin」和「User」)
「錯誤」似乎是您的項目的配置問題 – MadProgrammer
您發佈的代碼與NetBeans警告似乎沒有關係。 NetBeans只是警告您添加了不存在的路徑。 –