私は私のコードの断片を含めています。変数 fnh がクラス スコープで宣言されました (クラス定義の直後)。それでも、最後のステートメントで印刷することはできません。actionPerformed メソッド内に配置された場合、変数の値は出力されますが、その外部には出力されません。何が問題になる可能性がありますか?迅速な提案をいただければ幸いです。
public class Lamp  {
   int fnh;
   Lamp()  {
     // More code here
  String[] numberOfRunners = { "8", "9", "10", "11", "12",
                                "13", "14", "15", "16", "17",
                                "18", "19", "20", "21", "22" };
   runners = new JComboBox( numberOfRunners );
   runners.setMaximumRowCount(5);        
   runners.addActionListener( new ActionListener() {
        @Override
        public void actionPerformed( ActionEvent ae ) {
           String  runnersNumber = ( String )runners.getSelectedItem();
           fnh = Integer.parseInt( runnersNumber );           
           reducedFNH = reduce( fnh );
       }}
   );     
   middle.add( runners );
   System.out.println( fnh );
    // More code here
}
// その他のコード
クラスの終わり