以下のdouble変数(mon、tues、wedなど)を、作成しているアプリケーション全体で公開するにはどうすればよいですか?たとえば、最後の中括弧の後に行く場合、mon変数にアクセスできません。何か案は?
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());
double sum = mon + tues + wed + thurs + fri + sat + sun;
}
});