Q:

timer t = new timer(50, b); t.stop(); is not working

My t.stop(); method is not working. I am going crazy trying to figure out why my stop method is not working. 
I'm using the a timer in my code and I can't get it to stop. Can anyone take a look at it and tell me what's going on?:
/*Gilberto Rose*/
package homework2;

import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.Timer;

public class MultipleBalls extends JFrame implements ActionListener
{   

    int dx = 2;
int dy = 2;
int x = 1;
int y = 1;
int i = 0;

public static void main(String[] args)
{
    Runnable balls = new Ball2();

    Thread thread1 = new Thread(balls);

    thread1.run();

}

@Override
public void actionPerformed(ActionEvent arg0) 
{
    repaint();
    System.out.println(i++);
}

}// End of Ball class

class Ball2 extends JPanel implements Runnable
{
MultipleBalls b = new MultipleBalls();
JButton g = new JButton("resume");
JButton f = new JButton("suspend");
JButton e = new JButton("-1");
JButton d = new JButton("+1");
List<Ball2> L = new ArrayList<Ball2>();
Timer t = new Timer(50, b);
public int x = 6;

public void loopstop()
{
    t.stop();
}// end of loopstop method

Ball2()
{ 
    controller4();
    controller3();
    controller2();
    controller();
    add(d); 
    add(e);
    add(f);
    add(g);

}// End of Ball2 constructor

public void run() 
{

    Ball2 c = new Ball2();
    b.setSize(500, 500);
    b.setVisible(true);
    b.add(c);
    t.start();
} // End of run method

public void controller()
{
    d.addActionListener(new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            L.add(new Ball2());
        }
    });
}// End of controller

public void controller2()
{
    e.addActionListener(new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            System.out.println("subtracter");
            L.remove(L.size()-1);
        }
    });
}// End of controller2

public void controller3()
{    
    f.addActionListener(new ActionListener()
    {

        public void actionPerformed(ActionEvent e)
        {
             loopstop();
        }
    });
}// End of controller3

public void controller4()
{
    g.addActionListener(new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
         System.out.println("Resume"); 
        }
    });
}// End of controller4

public void paintComponent(Graphics g)
{

    if(L.size() > 0)

        {   
        int i = 0;
            do
        {       
            g.fillOval(L.get(i).ballx(), L.get(i).bally(), 90, 90);

            i++;
            }while(i < L.size() && true ); // End of Do while loop

        }// End of if statement

    }// End of paintComponent

MultipleBalls bb = new MultipleBalls();

public int ballx()
{
    if (bb.x == 0 || bb.x == 500)
    {
        bb.dx *= -1;

    } // End of if statement

    bb.x += bb.dx;

    return bb.x;
}

public int bally()
{
    if (bb.y == 0 || bb.y == 500 )
    {
        bb.dy *= -1;
    }// end of if statement

    bb.y += bb.dy;
    return bb.y;

}// End of bally

}// End of Ball2 class

A:

Your code is extremely convoluted, I believe that it's suffering from something called cyclomatic complexity, so much so, it is difficult for you or us to see what object is creating what other object, and what is running what. And this is your problem. You have at least two MultipleBall objects, two Ball2 objects, and you're starting the Timer for one of the Ball2 objects and stopping it for the other.
The solution: simplify this code greatly. 

Create one MultipleBalls object, just one.
Don't have MultipleBalls implement ActionListener. Rather use an anonymous inner class for your ActionListener and create it on the spot where you need it.
Create just one Ball2 object, just one.

Also note that you almost never call run() on a Thread object but rather start(), but having said that, I'm not even sure that you should be using a Thread object where you're using it.

Edit
My main class would be simple, and would simply have a main method and supporting method that gets things started. Something like:
public class MultipleBalls {

   private static void createAndShowGui() {
      BallsPanel mainPanel = new BallsPanel();

      JFrame frame = new JFrame("Multiple Balls");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().add(mainPanel);
      frame.pack();
      frame.setLocationByPlatform(true);
      frame.setVisible(true);
   }

   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
            createAndShowGui();
         }
      });
   }
}

Edit 
For an example of a separation of concerns:
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.swing.*;

public class MultipleBallsZ {

   private static void createAndShowGui() {
      BallsPanelZ ballsPanel = new BallsPanelZ();
      new Control(ballsPanel);

      JFrame frame = new JFrame("Multiple Balls");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().add(ballsPanel);
      frame.pack();
      frame.setLocationByPlatform(true);
      frame.setVisible(true);
   }

   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
            createAndShowGui();
         }
      });
   }
}

@SuppressWarnings("serial")
class BallsPanelZ extends JPanel {
   private static final int TIMER_DELAY = 200;
   private static final int PREF_W = 400;
   private static final int PREF_H = PREF_W;

   private Timer timer = new Timer(TIMER_DELAY, new TimerListener());
   private int counter = 0;
   private Control control = null;

   public BallsPanelZ() {
      timer.start();
   }

   @Override
   public Dimension getPreferredSize() {
      return new Dimension(PREF_W, PREF_H);
   }

   public Timer getTimer() {
      return timer;
   }

   private class TimerListener implements ActionListener {
      @Override
      public void actionPerformed(ActionEvent e) {
         counter++;
         System.out.printf("Count: %03d%n", counter);
      }
   }

   public void setControl(Control control) {
      this.control = control;
      for (Action action : control) {
         add(new JButton(action));
      }
   }
}

@SuppressWarnings("serial")
class Control implements Iterable<Action> {
   private List<Action> actionList = new ArrayList<>();
   private BallsPanelZ ballsPanel;

   public Control(BallsPanelZ ballsPanel) {
      actionList.add(new PauseAction());
      actionList.add(new ResumeAction());

      this.ballsPanel = ballsPanel;
      ballsPanel.setControl(this);
   }

   private class PauseAction extends AbstractAction {
      public PauseAction() {
         super ("Timer Pause");
         putValue(MNEMONIC_KEY, KeyEvent.VK_P);
      }

      @Override
      public void actionPerformed(ActionEvent e) {
         ballsPanel.getTimer().stop();
      }
   }

   private class ResumeAction extends AbstractAction {
      public ResumeAction() {
         super("Timer Resume");
         putValue(MNEMONIC_KEY, KeyEvent.VK_R);
         putValue(DISPLAYED_MNEMONIC_INDEX_KEY, 6);
      }

      @Override
      public void actionPerformed(ActionEvent e) {
         ballsPanel.getTimer().restart();
      }
   }

   @Override
   public Iterator<Action> iterator() {
      return actionList.iterator();
   }
}

