运行JFrame时java中的classnotfoundexception错误?

运行JFrame时java中的classnotfoundexception错误?,java,Java,我正在用java开发windows应用程序: 我只是测试了一个按钮,该按钮使函数登录到我的系统中: 我的按钮操作执行代码: private void loginActionPerformed(java.awt.event.ActionEvent evt) { if(emp.isSelected()) // get the selected radio button { Account a

我正在用java开发windows应用程序:

我只是测试了一个按钮,该按钮使函数登录到我的系统中:

我的按钮操作执行代码:

private void loginActionPerformed(java.awt.event.ActionEvent evt) {                                      
    if(emp.isSelected()) // get the selected radio button
    {
        Account a = new Account();
        Emp e = new Emp();
        a.setUsername(username.getText().toUpperCase());
        a.setPassword(password.getText().toUpperCase());
        e.login(a);
        this.dispose();
    }

    else if(supp.isSelected())
    {
    }

    else if(admin.isSelected())
    {
        Account a = new Account();
        Admin m = new Admin();
        a.setUsername(username.getText().toUpperCase());
        a.setPassword(password.getText().toUpperCase());
        m.login(a);
        this.dispose();
    }

    else
        JOptionPane.showMessageDialog(null, "Please select a choice", "Alert", JOptionPane.INFORMATION_MESSAGE);
} 
函数登录代码:

public class Emp
{

public void login(Account a)
{
    boolean find = false;
    ObjectInputStream in = null;
    try {
        in = new ObjectInputStream(new FileInputStream("C:\\Users\\فاطمة\\Downloads\\employees.bin"));
        ArrayList<Account> b = (ArrayList)in.readObject();
        Iterator<Account> i = b.iterator();
        while(i.hasNext())
        {
            Account ac = i.next();
            if(ac.getUsername().equals(a.getUsername()) && ac.getPassword().equals(a.getPassword()))
            {
                find = true;
            }
            else
                JOptionPane.showMessageDialog(null, "Wrong username or password .. try again !!", "Login Failed",JOptionPane.ERROR_MESSAGE);

        }
        if(find)
        {
            JOptionPane.showMessageDialog(null, "Welcome " + a.getUsername(), "Login Success", JOptionPane.INFORMATION_MESSAGE);
                emp_page e = new emp_page();
                e.setLocation(350, 150);
                e.setSize(400, 490);
                e.setTitle("Products Management");
                e.setVisible(true);
        }
    } catch (FileNotFoundException ex) {
        //Logger.getLogger(Emp.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException | ClassNotFoundException ex) {
        //Logger.getLogger(Emp.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        try {
            in.close();
        } catch (IOException ex) {
            //Logger.getLogger(Emp.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
}
我有两个问题:

第一:当我点击按钮登录。。。程序终止而不执行任何操作。 第二:运行我的代码时发生另一个错误:它抛出一个错误,显示:

 java.lang.classnotfoundexception: Account
注意:在默认包中运行代码时,代码运行良好,但当我将其移动到特定包时,这些问题就会出现。。。我做了重构,一切都很好,但还是一样的问题。。。我尝试创建新项目并再次编写代码,但仍然存在相同的问题


很抱歉发了这么长的帖子,但请有人告诉我如何解决这个问题?

所有的类都在同一个包中?@Abdelhak是的,先生,所有类都在同一个包中。。。我想知道为什么它不起作用。。。代码是完美的。只需一件事,试着在eclipse中发布包资源管理器,也许我会尽可能地使用图片do@Abdelhaknp先生,谢谢您的帮助:)
 java.lang.classnotfoundexception: Account