ArrayList<Integer> initgenome = new ArrayList<>(5000);
initgenome.addAll(Collections.nCopies(10, 1));
initgenome.addAll(Collections.nCopies(4990, 0));
ArrayList<Integer> genometwo = new ArrayList<>(5000);
genometwo.addAll(Collections.nCopies(10, 2));
genometwo.addAll(Collections.nCopies(4990, 0));
ArrayList<Integer> genomethree = new ArrayList<>(5000);
genomethree.addAll(Collections.nCopies(10, 3));
genomethree.addAll(Collections.nCopies(4990, 0));
ArrayList<Integer> genomefour = new ArrayList<>(5000);
genomefour.addAll(Collections.nCopies(10, 4));
genomefour.addAll(Collections.nCopies(4990, 0));
私はJavaを使用してEclipseでプロジェクトを行っていますが、初期化時にこれらのゲノムの1つをランダムにピッキングするオブジェクトを持っています。とにかく、それぞれのarraylistに色を付けることができれば、私は興味を持っていたので、拾ったゲノムを視覚的に見ることができましたか?ありがとう!ArrayListに色を割り当てる
どのように色を見たいですか?画面上? – Mordechai
プログラムを実行すると、グリッド上の微生物がポップアップ表示されます。今、彼らはすべて青です。 – ckrup92
どのようなGUIツールキットを使用していますか? Swing、JavaFX? – Mordechai