Hello if anyone can help I would like to know why I get this error when executing.. exception in thread "main" java.lang.NuSuchMethodError: main
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GridLayoutFrame extends JPanel
{
// These are the components
private JButton FindB,AddB,RemoveB;
private JLabel theOne,theTwo,theThree,theFour,studentID,theMidTerm,theMidterm,theFinal1,theFinal2,FinalG1,FinalG2,FGrade2;
private JList studentNumbers;
private JTextField mark1,mark2,mark3,mark4,markM,MarksF,FinalG;
Integer[] students;
public JList getActionList() {return studentNumbers;}
public JTextField getMark1() {return mark1;}
public JTextField getMark2() {return mark2;}
public JTextField getMark3() {return mark3;}
public JTextField getMark4() {return mark4;}
public JTextField getMarkM() {return markM;}
public JTextField getMarkF() {return MarksF;}
public JTextField getFinalGrade() {return FinalG;}
public GridLayoutFrame()
{
setLayout(new GridLayout(4,1,0,0));
add(theStudentList());
add(theTextField());
add(theLabel());
add(theButton());
}
public JPanel theStudentList()
{
JPanel sIdpanel = new JPanel();
sIdpanel.setLayout(null);
sIdpanel.setSize(430,353);
sIdpanel.setBorder(BorderFactory.createLineBorder (Color.GRAY));
JLabel studentID = new JLabel("Student ID");
studentID.setSize(153,23);
studentID.setLocation(18,12);
studentID.setFont(new Font("Times", Font.BOLD, 17));
sIdpanel.add(studentID);
JList studentNumbers = new JList();
JScrollPane scrollPane = new JScrollPane(studentNumbers,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.setLocation(15,38);
scrollPane.setSize(390,149);
sIdpanel.add(scrollPane);
return sIdpanel;
}
public JPanel theLabel()
{
JPanel theLabel2 = new JPanel();
theLabel2.setLayout(new GridLayout(1,8));
theLabel2.setLocation(30,500);
theLabel2.setSize(100,53);
theLabel2.setBorder(BorderFactory.createLineBorder (Color.GRAY));
theOne = new JLabel("A1");
theOne.setFont(new Font("Times", Font.BOLD, 16));
theLabel2.add(theOne);
theTwo = new JLabel("A2");
theTwo.setFont(new Font("Times", Font.BOLD, 16));
theLabel2.add(theTwo);
theThree = new JLabel("A3");
theThree.setFont(new Font("Times", Font.BOLD, 16));
theLabel2.add(theThree);
theFour = new JLabel("A4");
theFour.setFont(new Font("Times", Font.BOLD, 16));
theLabel2.add(theFour);
theMidTerm = new JLabel("Midterm");
theMidTerm.setFont(new Font("Times", Font.BOLD, 17));
theLabel2.add(theMidTerm);
theMidterm = new JLabel("Exam");
theMidterm.setFont(new Font("Times", Font.BOLD, 17));
theLabel2.add(theMidterm);
theFinal1 = new JLabel("Final");
theFinal1.setFont(new Font("Times", Font.BOLD, 17));
theLabel2.add(theFinal1);
theFinal2 = new JLabel("Exam");
theFinal2.setFont(new Font("Times", Font.BOLD, 17));
theLabel2.add(theFinal2);
FinalG1 = new JLabel("Final");
FinalG1.setFont(new Font("Times", Font.BOLD, 17));
theLabel2.add(FinalG1);
FGrade2 = new JLabel("Grade");
FGrade2.setFont(new Font("Times", Font.BOLD, 17));
theLabel2.add(FGrade2);
return theLabel2;
}
public JPanel theTextField()
{
JPanel markValuesPanel = new JPanel();
markValuesPanel.setLayout(new GridLayout(1,7,5,5));
markValuesPanel.setSize(10,10);
markValuesPanel.setLocation(18,100);
mark1 = new JTextField("25");
markValuesPanel.add(mark1);
mark2 = new JTextField("14.5");
markValuesPanel.add(mark2);
mark3 = new JTextField("31.5");
markValuesPanel.add(mark3);
mark4 = new JTextField("30");
markValuesPanel.add(mark4);
markM = new JTextField("19.5");
markValuesPanel.add(markM);
MarksF = new JTextField("60");
markValuesPanel.add(MarksF);
FinalG = new JTextField("A-");
markValuesPanel.add(FinalG);
return markValuesPanel;
}
public JPanel theButton()
{
JPanel theButtons = new JPanel();
theButtons.setLayout(new GridLayout(1,3,24,24));
theButtons.setSize(100,200);
theButtons.setLocation(50,150);
FindB = new JButton("Search");
FindB.setFont(new Font("Times", Font.BOLD, 17));
theButtons.add(FindB);
AddB = new JButton("Add");
AddB.setFont(new Font("Times", Font.BOLD, 17));
theButtons.add(AddB);
RemoveB = new JButton("Remove");
RemoveB.setFont(new Font("Times", Font.BOLD, 17));
theButtons.add(RemoveB);
return theButtons;
}
public JTextField getA1TextField(){return mark1;}
public JTextField getA2TextField(){return mark2;}
public JTextField getA3TextField(){return mark3;}
public JTextField getA4TextField(){return mark4;}
public JTextField getMidTermTextField(){return markM;}
public JTextField getFinalExamTextField(){return MarksF;}
public JTextField getFinalGradeTextField(){return FinalG;}
public JList getStudentIDList(){return studentNumbers;}
public void setStudentIDList(Integer[] studentIDs){studentNumbers.setListData(studentIDs) ;}
}
Thanks!