error: illegal start of expression 1 error

Below is partially fixed part of the code which causes problems. Next time include full error code, and try to show only relevant part of the code.

ActionListener listener = new ActionListener() {
    public void actionPerformed (ActionEvent e) {
        float P,r,t,result ;
        //P = Float.parseFloat(P.getText()); // P makes no sens here - its float !!! and uninitialized
        //r = Float.parseFloat(r.getText()); // same for r
        //t = Float.parseFloat(t.getText()); // same for t
        result = P*r/100*t/360;
        button.setText(String.valueOf(result));
    }
};
button.addActionListener (listener);

Leave a Comment