1

重複の可能性:
JComboBox の値

私はこのようなコードを持っています:

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");
        }
    }
}

JComboBox を持ち、新しいオプションを作成するプログラムを作成するにはどうすればよいですか?

String[] {"...", "..."};

見つかった各デバイスの JComboBox の配列? ありがとう!PS私はJInputを使用しています。

4

0 に答える 0