title: Declaring integers in actionPerformed java
body: <p>So I'm trying to create this program in Java that's supposed to keep track of how much stock there is. Like if you wanted to cook pancakes, you would click a button that said "pancakes" and 1xmilk, 2xtimes egg would be removed from the stock every time you click the button, the problem is that I have to declare the integers inside the <code>actionPerformed()</code>, so every time I click the button the original values reset, does any kind soul have the answer? </p>
  
  <pre><code>//1100 Button
              JButton bj1100 = new JButton("1100");
              f.add(bj1100);
              bj1100.addActionListener(new ActionListener(){
  
                  @Override
                  public void actionPerformed(ActionEvent e) {
                      // TODO Auto-generated method stub
                      System.out.println("1100");
                      //1100 head menu
  
                      MAIN f = new MAIN();
                      f.setLayout(new FlowLayout());
  
                      //250/1100 HYDR
                              JButton bj250HYDR = new JButton("250/1100 HYDR");
                              f.add(bj250HYDR);
                              bj250HYDR.addActionListener(new ActionListener(){
  
         @Override
          public void actionPerformed(ActionEvent e) {
  
          // TODO Auto-generated method stub
          System.out.println("Building a250/110 HYDR");
  
  
                                      //Stock
                                      int lOmaxel =10;
                                      int lVals = 10;
  
                                      //Orderpoint
                                      int bOmaxel =5;
                                      int bVals = 5;
  
                                      //Amount to make
                                      int tOmaxel =10;
                                      int tVals =10;
                                      lOmaxel--;
                                      lVals--;
      }
  
  });
  </code></pre>