嗨,我的问题是,在我的代码我打电话的方法,计算2点之间的差异,然后如果该距离少于7,它会调用另一个类应该改变目标的颜色为红色的方法...我的问题是在我的arraylist我有3或5或取决于用户输入目标...所以我如何指定我的数组列表中的对象将要更改颜色> ???这是我的代码
package project1;
import java.util.*;
import javax.swing.*;
/**
*
* @author Elvis De Abreu
*/
public class TargetGallery
{
/**ArrayList of Targets initialize as a private*/
private ArrayList mytargets = new ArrayList<>();
/**Static object for the Target class*/
static Target tg = new Target();
/**Static object for the RifleSite class*/
static RifleSite rs = new RifleSite();
/**Static object for the TargetGallery class*/
static TargetGallery tgy = new TargetGallery();
/**the number of targets input by the user as private*/
private int number = 0;
/**array that store