title: When I try running this class in eclipse, another class gets executed
body: <p>I have this class called deepToe_2. Whenever I click on the shortcut key for run, eclipse runs another class called TicTacToe which I had previously ran.
  I have tried making changes to run cofig but it still does not seem to work.
  Here is my code :</p>
  
  <pre><code>package deepToe;
  
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.util.*;
  import javax.swing.*;
  import deepToe.deepToe_2.buttonListener;
  
  public class deepToe_2 extends JPanel {
  
  JButton buttons[] = new JButton[9]; 
  int alternate = 0;
  String MotherBoard[] = {"","","","","","","","",""};
  String board[];
  
  public static void main(String[] args) {
  
      JFrame window = new JFrame("Tic Tac Toe");
      window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      window.getContentPane().add(new TicTacToe());
      window.setBounds(300,200,300,300);
      window.setVisible(true);
  }
  
  public deepToe_2()
  {
    setLayout(new GridLayout(3,3));
    initializebuttons();
    toss();
  }
  
  public void toss(){
      Random ran = new Random();
      int r = ran.nextInt(2);
      if(r == 1){
          JOptionPane.showMessageDialog(null, "deepToe goes First.");
          alternate++;
          deepToe();
      }
      else {
          JOptionPane.showMessageDialog(null, "deepToe goes First.");
          alternate++;
          deepToe();
      }
  }
  
  public void deepToe() {
      if(alternate == 1) {
          buttons[4].setText("O");
      }else {
          int moves[] = {-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000};
          for(int i = 0; i &lt; 9; i++) {
              board = MotherBoard;
              if(board[i] == "") {
                  board[i] = "O";
                  moves[i] = evaluateBoard();
              }
          }
          int high = -999, final_move = -1;
          for(int j = 0; j &lt; 9; j++) {
              if(moves[j] &gt; high){
                  high = moves[j];
                  final_move = j;
              }
          }
          buttons[final_move].setText("O");
      }
      updateMotherBoard();
      if(!(checkResults())) alternate++;
  }
  
  public int evaluateBoard() {
      int x = 0;
      if(canSomeoneWin("O") != -1) x += 2;
      if(canSomeoneWin("X") != -1) x -= 2;
      return x;
  }
  
  public void updateMotherBoard() {
      for(int i = 0; i &lt; 9; i++) {
          MotherBoard[i] = buttons[i].getText();
      }
  }
  
  public int canSomeoneWin(String c) {
      int x = 0, y = 1, z = 2;
      for(int j = 0; j &lt; 3; j++){
          if((board[y] == board[z])&amp;&amp;(board[y] == c)&amp;&amp;(board[x] == "")) return x;
          if((board[x] == board[z])&amp;&amp;(board[x] == c)&amp;&amp;(board[y] == "")) return y;
          if((board[x] == board[y])&amp;&amp;(board[x] == c)&amp;&amp;(board[z] == "")) return z;
          x += 3;
          y += 3;
          z += 3;
      }
      x = 0; y = 3; z = 6;
      for(int j = 0; j &lt; 3; j++){
          if((board[y] == board[z])&amp;&amp;(board[y] == c)&amp;&amp;(board[x] == "")) return x;
          if((board[x] == board[z])&amp;&amp;(board[x] == c)&amp;&amp;(board[y] == "")) return y;
          if((board[x] == board[y])&amp;&amp;(board[x] == c)&amp;&amp;(board[z] == "")) return z;
          x++;
          y++;
          z++;
      }
      x = 0; y = 4; z = 8;
      for(int j = 0; j &lt; 2; j++){
          if((board[y] == board[z])&amp;&amp;(board[y] == c)&amp;&amp;(board[x] == "")) return x;
          if((board[x] == board[z])&amp;&amp;(board[x] == c)&amp;&amp;(board[y] == "")) return y;
          if((board[x] == board[y])&amp;&amp;(board[x] == c)&amp;&amp;(board[z] == "")) return z;
          x = 2; z = 6;
      }
      return -1;
  
  }
  
  public void initializebuttons()
  {
      for(int i = 0; i &lt;= 8; i++)
      {
          buttons[i] = new JButton();
          buttons[i].setText("");
          buttons[i].addActionListener(new buttonListener());
  
          add(buttons[i]);           
      }
      buttons[5].setText("X");
  
  }
  
  public class buttonListener implements ActionListener
  {
  
      public void actionPerformed(ActionEvent e) 
      {
  
          JButton buttonClicked = (JButton)e.getSource(); 
  
          if((alternate%2 == 0)&amp;&amp;(buttonClicked.getText().equals(""))){
              buttonClicked.setText("X");
              updateMotherBoard();
              if(!(checkResults())) {
                  alternate++;
                  deepToe();
              }
          }
  
      }
  }
  
      public boolean checkResults(){
          if(checkForWin())
          {
              if(alternate%2 == 0)
                  JOptionPane.showConfirmDialog(null, "Human wins. Great Job!!!");
              else
                  JOptionPane.showConfirmDialog(null, "deepToe wins.");  
              return true;
          }else{
              if(checkForDraw()){
                  JOptionPane.showConfirmDialog(null, "Draw. Good game.");
                  return true;
              }
          }
          return false;
  
      }
  
      public boolean checkForDraw() {
          boolean yes = true;
          for(int j = 0; j &lt; 9; j++){
              if(buttons[j].getText().equals("")) yes = false;
          }
          return yes;
      }
  
      public boolean checkForWin()
      {
          if( checkAdjacent(0,1) &amp;&amp; checkAdjacent(1,2) ) //no need to put " == true" because the default check is for true
              return true;
          else if( checkAdjacent(3,4) &amp;&amp; checkAdjacent(4,5) )
              return true;
          else if ( checkAdjacent(6,7) &amp;&amp; checkAdjacent(7,8))
              return true;
          else if ( checkAdjacent(0,3) &amp;&amp; checkAdjacent(3,6))
              return true;  
          else if ( checkAdjacent(1,4) &amp;&amp; checkAdjacent(4,7))
              return true;
          else if ( checkAdjacent(2,5) &amp;&amp; checkAdjacent(5,8))
              return true;
          else if ( checkAdjacent(0,4) &amp;&amp; checkAdjacent(4,8))
              return true;  
          else if ( checkAdjacent(2,4) &amp;&amp; checkAdjacent(4,6))
              return true;
          else 
              return false;
  
  
      }
  
      public boolean checkAdjacent(int a, int b)
      {
          if ( buttons[a].getText().equals(buttons[b].getText()) &amp;&amp; !buttons[a].getText().equals("") )
              return true;
          else
              return false;
      }
  
  }
  </code></pre>