New to Java....still learning...Help Required
Hi i'm trying to grasp Java via reading tutorials..
I'm trying to setup a small quiz but getting nowhere..
My code is below
================================================== =======
package footballquiz;
import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class Main {
private static void createAndShowGUI() {
//Create window
JFrame frame = new JFrame("main");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
JLabel emptyLabel = new JLabel("main");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
//Display Window
//Display the window.
frame.pack();
frame.setVisible(true);
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
================================================
when running i get the following error..
"Footballquiz.Main class wasn't found in FootballQuiz project"
Can anyone shed light on this please.... and point me in the right direction...
Thanks in advance
Re: New to Java....still learning...Help Required
Quote:
Originally Posted by
muraduk
"Footballquiz.Main class wasn't found in FootballQuiz project"
when you start a java program the jvm is looking for a method main with exactly this signature
public static void main(String[] args)
this is the entry-point of your program. if the jvm doesn't found this default entry-point an error is thrown and the execution is aborted.
Re: New to Java....still learning...Help Required