首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

noclassdeffounderror解决思路

2012-04-17 
noclassdeffounderrorpackage com.pllpwy.Login public class LoginUI implements ActionListener {JFram

noclassdeffounderror
package com.pllpwy.Login;
 
public class LoginUI implements ActionListener {
JFrame j;
JLabel jLabel1;
JLabel jLabel2;
JLabel jLabel3;
JLabel jLabel4;
JButton jButton3;
JButton jButton2;
JButton jButton1;
JPasswordField jPasswordField1;
JTextField jTextField1;
Icon i;

public LoginUI() {
j = new JFrame();
//节省空间。代码略。。。
  j.setResizable(false);
j.setLocation(300, 200);
j.setVisible(true);
j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

public void actionPerformed(ActionEvent e) {

char[] pwd = jPasswordField1.getPassword();
String userpwd = new String(pwd);
String username = jTextField1.getText();

//JOptionPane.showMessageDialog(null, e.getActionCommand());

}

public static void main(String[] args) {
new LoginUI();
}

}


为什么在eclipse下面运行的时候提示:
java.lang.NoClassDefFoundError: com/pllpwy/Login/LoginUI
Caused by: java.lang.ClassNotFoundException: com.pllpwy.Login.LoginUI

它执行的时候,明显执行到了LoginUI文件夹下面去了。这个文件夹肯定不存在的了,这个是邮什么引起的?

[解决办法]

Java code
package com.pllpwy.Login;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.Icon;import javax.swing.JButton;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPasswordField;import javax.swing.JTextField;public class LoginUI implements ActionListener {JFrame j;JLabel jLabel1;JLabel jLabel2;JLabel jLabel3;JLabel jLabel4;JButton jButton3;JButton jButton2;JButton jButton1;JPasswordField jPasswordField1;JTextField jTextField1;Icon i;public LoginUI() {j = new JFrame();//节省空间。代码略。。。  j.setResizable(false);j.setLocation(300, 200);j.setVisible(true);j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);}public void actionPerformed(ActionEvent e) {char[] pwd = jPasswordField1.getPassword();String userpwd = new String(pwd);String username = jTextField1.getText();//JOptionPane.showMessageDialog(null, e.getActionCommand());}public static void main(String[] args) {new LoginUI();}} 

热点排行