title: ActionListener reset variable's current value to default
body: <p>I'm working on a project for a simple game where you can go to different rooms by using buttons (north, east, west, south). Within the makeFrame() method of my gui I'm creating the panel, buttons etc. I then set the default room to "hall" for example and the actionlistener calls the method goRoom and passing the direction and currentRoom to that method. The goRoom method change the currentRoom to another room depending on the currentRoom. I included print statements to see if it works and so far it works fine.</p>
  
  <p>Everytime the game starts the default room is the hall.
  So when you click a button to go for example "North", the northButton is called in which then we call the goRoom method passing the direction (north) and the default room "hall" (as the game just starts and uses the default room).
  Then the room changes from hall to state room (within the method goRoom). When I try to press another button the currentRoom reset to the default value (hall). </p>
  
  <p>I think the action listener get the value from the makeFrame() method instead of the updated value from the goRoom method. The code is below:</p>
  
  <pre><code>public class StoreGUI extends JFrame
  {
      public String currentRoom;
  
      public StoreGUI()
      {
          makeFrame();
      }
  
  
      private void makeFrame()
      { 
          currentRoom = "hall";
          ....
  
  
          northButton = new JButton("Go North");
          northButton.addActionListener(new ActionListener() {
                                 public void actionPerformed(ActionEvent e) { 
                                     direction = "north";
                                     goRoom(direction, currentRoom); }
                             });
          toolbar.add(northButton);
  
          westButton ....
          southButton ....      
          eastButton ....
  
          picture.setIcon(new ImageIcon("image/hall.png"));
          frame.getContentPane().add(picture);
          frame.pack();
          frame.setVisible(true);
      }
  
  private void goRoom(String direction, String currentRoom)
      {
          // get current room and check which direction button the user has pressed
          if (direction == "north"){
              if(currentRoom == "hall"){
                  // Inserts the image icon and change currentRoom
                  imgageTitle = "image/stateRoom.png";
                  currentRoom = "stateRoom";
              }
              ....
  }
  </code></pre>
  
  <p>What the problem could be? How can I fix that? I'm pretty sure it's something really simple but I'm stack.</p>