Possible Duplicate:
Values of JComboBox
I have a code like this:
import net.java.games.input.Controller;
import net.java.games.input.Controller.Type;
import net.java.games.input.ControllerEnvironment;
public class ControllerFinder
{
public static void main(String[] args)
{
try
{
ControllerEnvironment ce = ControllerEnvironment.getDefaultEnvironment();
Controller[] cs = ce.getControllers();
for (int i = 0; i < cs.length; i++)
{
String name = cs[i].getName();
Type type = cs[i].getType();
}
}
catch (Exception exc)
{
System.err.println("No controller found");
}
}
}
How could I make a program that has a JComboBox and creates a new option in the
String[] {"...", "..."};
array for the JComboBox for each device found? Thanks! P.S. I am using JInput.