I get this when I try to load my program, yet the compiler says its fine. Please help!
Exception in thread "main" java.lang.NoClassDefFoundError: PIStudy$DoPolyINTest
at PIStudy.<init>(PIStudy.java:51)
at PIStudy.main(PIStudy.java:121)
import javax.swing.*;
import java.util.Random;
import java.awt.*;
import java.awt.event.*;
public class PIStudy {
public JFrame window;
public JButton name;
public JButton comb;
public JButton ioni;
public JLabel resultLabel;
public int correct;
public int problems;
public String input;
public final String[] PolyIC = {/*stuff*/};
public final String[] PolyIN = {/*stuff*/};
public final String[] PolyII = {/*stuff*/};
public PIStudy() {
window = new JFrame();
window.setTitle("Polyatomic Ion Study Program");
window.getContentPane().setLayout(new BoxLayout(window.getContentPane(),
BoxLayout.PAGE_AXIS));
name = new JButton("Test for Name");
name.addActionListener(new DoPolyINTest());
window.getContentPane().add(name);
comb = new JButton("Test for Combination");
comb.addActionListener(new DoPolyICTest());
window.getContentPane().add(comb);
ioni = new JButton("Test for Ionization");
ioni.addActionListener(new DoPolyIITest());
window.getContentPane().add(ioni);
resultLabel = new JLabel("Ready..................................");
window.getContentPane().add(resultLabel);
window.pack();
}
class DoPolyICTest implements ActionListener {
public void actionPerformed(ActionEvent c) {
Random gen = new Random();
int randNum = gen.nextInt(PolyIC.length + 1);
input = null; //JOptionPane.showInputDialog(PolyIC[randNum]);
if (input.equals(PolyIN[randNum])) {
resultLabel.setText("Correct!");
correct++; problems++;
} else {
resultLabel.setText("Sorry, the correct answer is " +
PolyIN[randNum]);
problems++;
}
}
}
class DoPolyINTest implements ActionListener {
public void actionPerformed(ActionEvent n) {
Random gen = new Random();
int randNum = gen.nextInt(PolyIN.length + 1);
input = null; //JOptionPane.showInputDialog(PolyIN[randNum]);
if (input.equals(PolyIC[randNum])) {
resultLabel.setText("Correct!");
correct++; problems++;
} else {
resultLabel.setText("Sorry, the correct answer is " +
PolyIC[randNum]);
problems++;
}
}
}
class DoPolyIITest implements ActionListener {
public void actionPerformed(ActionEvent e) {
Random gen = new Random();
int randNum = gen.nextInt(PolyIC.length + 1);
input = null; //JOptionPane.showInputDialog(PolyIC[randNum]);
if (input.equals(PolyII[randNum])) {
resultLabel.setText("Correct!");
correct++; problems++;
} else {
resultLabel.setText("Sorry, the correct answer is " +
PolyII[randNum]);
problems++;
}
}
}
public static void main(String[] args) {
PIStudy gui = new PIStudy();
gui.window.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e) { System.exit(0); }
});
gui.window.setVisible(true);
}
}