Курсовая работа: Метод последовательных сравнений
}
}
4.2 Класс «ConditionPanel»
public class ConditionPanel extends javax.swing.JPanel {
public ConditionPanel() {
initComponents();
}
public void setCondition(int indices[], int num) {
String s;
s = " " + (indices[0] + 1) + " > ";
for (int i = 1; i < indices.length - 1; i++) {
s += (indices[i] + 1) + " + ";
}
s += (indices[indices.length - 1] + 1);
jLabel1.setText("" + num + ". " + s);
}
public void check() {
jCheckBox1.setSelected(!jCheckBox1.isSelected());
}
boolean isSelected() {
return jCheckBox1.isSelected();
}
}
4.3 Класс «MainFrame»
public class MainFrame extends javax.swing.JFrame {
/** Creates new form MainFrame */
public MainFrame() {
initComponents();
jList1.setCellRenderer(new ListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {