. BNextRow.addActionListener (new ActionListener () {void actionPerformed (ActionEvent e) {(table.getRowCount ()> 0) {rowCount=table.getRowCount (); selRow=table.getSelectedRow (); (selRow == rowCount - 1) {. setRowSelectionInterval (0, rowCount - 1);
} else {selNextRow=selRow + 1;. setRowSelectionInterval (0, selNextRow);. scrollRectToVisible (new Rectangle (table.getCellRect (selNextRow, 0, true)));
}
} else {. showMessageDialog (null, «Втабліценетзапісей.», «Помилка!», JOptionPane.ERROR_MESSAGE);
}
}
});
/ ** Дія для кнопки вибору останнього рядка. * /. BLastRow.addActionListener (new ActionListener () {void actionPerformed (ActionEvent e) {rowCount=table.getRowCount (); (rowCount> 0) {. SetRowSelectionInterval (0, rowCount - 1);. ScrollRectToVisible (new Rectangle ( table.getCellRect (rowCount - 1, 0, true)));
} else {. showMessageDialog (null, «Втабліценетзапісей.», «Помилка!», JOptionPane.ERROR_MESSAGE);
}
}
});
}
/ ** Призначення дій для компонентів, що реалізують модифікацію бази даних через таблицю. * / Static void initTableModCompsActions () {
/ ** Дія для кнопки додавання нового рядка. * /. AddActionListener (new ActionListener () {void actionPerformed (ActionEvent e) {rowCount=table.getRowCount ();. AddRow (new Object [] {null, null, null, null, null, null, null, null, null }); counter=0; (rowCount == 0 | | (Integer) table.getValueAt (0, 0)> 1) {= 1;
} else {(rowCount == 1) {= 2;
} else {(int i=0; i
} else {= rowCount + 1;. setValueAt (counter, rowCount, 0); {. moveToInsertRow ();. updateInt (1, (Integer) table.getValueAt (rowCount, 0)); . insertRow (); (); ();
} catch (Exception ex) {
}. setRowSelectionInterval (0, counter - 1);. setColumnSelectionInterval (0, 0);. scrollRectToVisible (new Rectangle (table.getCellRect (counter - 1, 0, true))); p>
}
});
/ ** Дія для кнопки видалення обраного рядка. * /. AddActionListener (new ActionListener () {void actionPerformed (ActionEvent e) {selRow=table.getSelectedRow (); (table.getRowCount ()> 0) {{. Absolute (selRow + 1);. DeleteRow (); . removeRow (selRow);
} catch (SQLException ex) {
} (table.getRowCount ()> 0) {(selRow
} else {. setRowSelectionInterval (selRow - 1, selRow - 1);
}
} else {. showMessageDialog (null, «У таблиці немає записів.», «Помилка!», JOptionPane.ERROR_MESSAGE);
}
}
});
/ ** Дія для кнопки збереження змін в обраній рядку. * /. AddActionListener (new ActionListener () {void actionPerformed (ActionEvent e) {selRow=table.getSelectedRow (); cc=table.getColumnCount (); (table.getRowCo...