d. 主要事件处理代码:
private void confirmJDKHomeBtnActionPerformed(java.awt.event.ActionEvent evt) {
String jdkHomeInput = jdkHomeTextField.getText();
nBConfFile.setNetBeansJDKHome(jdkHomeInput);
}
private void addParasBtnActionPerformed(java.awt.event.ActionEvent evt) {
String newValue = (String) this.argumentsTbl.getCellEditor(
this.argumentsTbl.getEditingRow(), 0).getCellEditorValue();
Vector<String> newRow = new Vector<String>();
newRow.add(newValue);
this.argsTblModel.addRow(newRow);
}
private void removeParasBtnActionPerformed(java.awt.event.ActionEvent evt) {
int selectedRow = this.argumentsTbl.getSelectedRow();
this.argsTblModel.removeRow(selectedRow);
nBConfFile.removeNetBeansDefaultOptions(selectedRow);
}
private void argumentsTblPropertyChange(java.beans.PropertyChangeEvent evt) {
int selectedRow = this.argumentsTbl.getSelectedRow();
if (selectedRow >= 0 && selectedRow <= nBConfFile.getNetBeansDefaultOptions().
size()) {
// edit parameter
String newValue = this.argsTblModel.getValueAt(selectedRow,
0).toString();
nBConfFile.editNetBeansDefaultOptions(selectedRow, newValue);
} else if (selectedRow >= 0 && this.argsTblModel != null &&
this.argsTblModel.getValueAt(selectedRow, 0) != null) {
// add parameter
String newValue = this.argsTblModel.getValueAt(selectedRow,
0).toString();
nBConfFile.addNetBeansDefaultOptions(newValue);
}
}