Курсовая работа: Метод последовательных сравнений
comp.setBackground(isSelected ? Color.LIGHT_GRAY : Color.white);
return comp;
}
});
jList1.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
vec.get(jList1.getSelectedIndex()).check();
jList1.updateUI();super.mouseReleased(e);
}
});
jSpinner1.setValue(2);
}
private Vector<ConditionPanel> vec;
private LinkedList<int[]> conditions;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int value = (Integer)jSpinner1.getValue();
conditions = new LinkedList<int[]>();
int[] lastNumIndex = new int[value];
for(int num : lastNumIndex) {
System.out.println(num);
}
for (int i = 3; i <= value; i++) {
int[] indices;
CombinationGenerator x = new CombinationGenerator(value, i);
while (x.hasMore()) {
indices = x.getNext();
conditions.add(indices.clone());
}