何か案は ?66 行目は中かっこです。下に表示されます。下に // を付けて表示します。日食では、エラーが発生し続け、それを取り除く方法をidkします。何か案は?ありがとう!アクション リスナーの後に書き込みます。閉じるのを忘れましたか?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class operation extends JFrame{
private JTextField monday;
private JTextField tuesday;
private JTextField wednesday;
private JTextField thursday;
private JTextField friday;
private JTextField saturday;
private JTextField sunday;
private JButton finalize;
public operation(){
super("Weekly Total Calculator");
setLayout(new FlowLayout());
monday = new JTextField("How much you spent Monday", 20);
monday.setFont(new Font("Ariel", Font.PLAIN, 14));
add(monday);
tuesday = new JTextField("How much you spent Tuesday", 20);
tuesday.setFont(new Font("Ariel", Font.PLAIN, 14));
add(tuesday);
wednesday = new JTextField("How much you spent Wednesday", 20);
wednesday.setFont(new Font("Ariel", Font.PLAIN, 14));
add(wednesday);
thursday = new JTextField("How much you spent Thursday", 20);
thursday.setFont(new Font("Ariel", Font.PLAIN, 14));
add(thursday);
friday = new JTextField("How much you spent Friday", 20);
friday.setFont(new Font("Ariel", Font.PLAIN, 14));
add(friday);
saturday = new JTextField("How much you spent Saturday", 20);
saturday.setFont(new Font("Ariel", Font.PLAIN, 14));
add(saturday);
sunday = new JTextField("How much you spent Sunday", 20);
sunday.setFont(new Font("Ariel", Font.PLAIN, 14));
add(sunday);
finalize = new JButton("Calculate!");
add(finalize);
finalize.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
double mon = Double.parseDouble(monday.getText());
double tues = Double.parseDouble(tuesday.getText());
double wed = Double.parseDouble(wednesday.getText());
double thurs = Double.parseDouble(thursday.getText());
double fri = Double.parseDouble(friday.getText());
double sat = Double.parseDouble(saturday.getText());
double sun = Double.parseDouble(sunday.getText());
private double sum = mon + tues + wed + thurs + fri + sat + sun;
JOptionPane.showMessageDialog(null, "Your total is " + sum + "!", "Total", JOptionPane.PLAIN_MESSAGE);
}
}
//THIS IS THE ERROR^
}
}
助けてください!どんなアイデアでもうまくいきます。私は本当に契約が何であるか分かりません:(