Looking for Java help! I am working on the payroll program below and would like some help please. When I run the prograom, I am using jGrasp, the program runs with no errors identified in the code but I get the following window that pops up...."No main methods, applets, or MIDlets found in file. What do I need to do please help.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class payroll extends JFrame
{
private JLabel daysL,rateL,gpayL,deductionsL,taxL,sssL,cashadvL,totaldL,netpayL;
private JTextField daysTF,rateTF,gpayTF,taxTF,sssTF,cashadvTF,deductionTF,totaldTF,netpayTF;
private JButton calculateB, exitB;
private CalculateButtonHandler cbHandler;
private ExitButtonHandler ebHandler;
private static final int WIDTH=400;
private static final int HEIGHT=500;
public payroll()
{
daysL = new JLabel("Number of days Worked",SwingConstants.RIGHT);
rateL = new JLabel("Rate Per Day",SwingConstants.RIGHT);
gpayL = new JLabel("Gross Pay",SwingConstants.RIGHT);
taxL = new JLabel("With Tax(10%)",SwingConstants.RIGHT);
sssL = new JLabel("SSS (8%)",SwingConstants.RIGHT);
cashadvL = new JLabel("Cash Advance:",SwingConstants.RIGHT);
totaldL = new JLabel("Total Deduction:",SwingConstants.RIGHT);
netpayL = new JLabel("Total Net Pay",SwingConstants.RIGHT);
daysTF = new JTextField(10);
rateTF = new JTextField(10);
gpayTF = new JTextField(10);
taxTF = new JTextField(10);
sssTF = new JTextField(10);
cashadvTF = new JTextField(10);
totaldTF = new JTextField(10);
netpayTF = new JTextField(10);
calculateB = new JButton("Calculate");
cbHandler = new CalculateButtonHandler();
calculateB.addActionListener(cbHandler);
exitB = new JButton("Exit");
ebHandler = new ExitButtonHandler();
exitB.addActionListener(ebHandler);
setTitle("7'11 Payroll");
Container pane=getContentPane();
pane.setLayout(new GridLayout(9,2));
pane.add(daysL);
pane.add(daysTF);
pane.add(rateL);
pane.add(rateTF);
pane.add(gpayL);
pane.add(gpayTF);
pane.add(taxL);
pane.add(taxTF);
pane.add(sssL);
pane.add(sssTF);
pane.add(cashadvL);
pane.add(cashadvTF);
pane.add(totaldL);
pane.add(totaldTF);
pane.add(netpayL);
pane.add(netpayTF);
pane.add(calculateB);
pane.add(exitB);
setSize(WIDTH, HEIGHT);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public class CalculateButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
double days,rate,gpay,tax,sss,totald,cashadv,netpay;
days = Double.parseDouble(daysTF.getText());
rate = Double.parseDouble(rateTF.getText());
gpay = Double.parseDouble(gpayTF.getText());
tax = Double.parseDouble(taxTF.getText());
sss = Double.parseDouble(sssTF.getText());
totald = Double.parseDouble(totaldTF.getText());
netpay = Double.parseDouble(netpayTF.getText());
cashadv = Double.parseDouble(cashadvTF.getText());
gpay = (days*rate);
tax = (gpay*.10);
sss = (tax*.08);
totald =(tax+sss)+cashadv;
netpay =(gpay-totald);
}
}
private class ExitButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
System.exit(0);
}
}
}