Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners NoClassDefFoundException
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ashu
NoClassDefFoundException
1 Answer(s)      5 years and 3 months ago
Posted in : Java Beginners


following code has compiled sucessfully but at run time it givs error "NoClassDefFoundException". no other erorr


import java.awt.*;
import java. awt.event.*;

public class marks extends Frame implements ActionListener
{
Label l= new Label("enter the roll");
Label l1= new Label("enter the name");
Label l2= new Label("enter the marks");
TextField t= new TextField(10);
TextField t1= new TextField(10);
TextField t2= new TextField(10);
TextField t3= new TextField(10);
Button b= new Button("Result");
Button b1= new Button("Exit");

marks(String s)
{
super (s);
setLayout(new GridLayout(5,2));
add(l);
add(t);
add(l1);
add(t1);
add(l2);
add(t2);
add(t3);
add(b);
add(b1);
b.addActionListener(this);
b1.addActionListener(this);
}

public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b)
{
int n = Integer.parseInt(t2.getText());
if(n>=60)
{
t3.setText("Pass");
}
else
{
t3.setText("Fail");
}
}
if(e.getSource()==b1)
{
System.exit(0);
}
}
public static void main(String args[])
{
marks m = new marks("my Frame");
m.setSize(300,300);
m.setVisible(true);
}
}

Advertisement
View Answers

January 22, 2010 at 2:49 PM


Hi Friend,

It seems that you haven't saved your class with marks.java.Therefore you have got this error.

Thanks


Related Tutorials/Questions & Answers:
NoClassDefFoundException - Java Beginners
NoClassDefFoundException  following code has compiled sucessfully but at run time it givs error "NoClassDefFoundException". no other erorr import java.awt.*; import java. awt.event.*; public class marks extends Frame
Advertisements
 

 

 

DMCA.com