我有一个表,它显示来自sql server的一些数据,当我点击它时,它还显示直接从表中获取它的文本字段的数据。但是一旦我点击桌子上的一行,它就会一直点击,直到框架关闭。我该如何禁用它?这是关于点击事件的代码。
int rowIndex;
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {
rowIndex = jTable1.getSelectedRow();
DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
if(model.getValueAt(rowIndex, 3).toString().equals("Mashkull "))
{
jRadioButton1_mashkull1.setSelected(true);
jRadioButton2_femer1.setSelected(false);
} else {
jRadioButton2_femer1.setSelected(true);
jRadioButton1_mashkull1.setSelected(false);
}
jTextField1_id1.setText(model.getValueAt(rowIndex, 0).toString());
jTextField1_emri1.setText(model.getValueAt(rowIndex, 1).toString());
jTextField1_mbiemri2.setText(model.getValueAt(rowIndex, 2).toString());
jTextField1_nrtel1.setText(model.getValueAt(rowIndex, 5).toString());
jTextArea1_adresa1.setText(model.getValueAt(rowIndex, 6).toString());
Date bdate;
try {
bdate= new SimpleDateFormat("yyyy-MM-dd").parse(model.getValueAt(rowIndex, 4).toString());
jDateChooser1_data1.setDate(bdate);
} catch (ParseException ex) {
Logger.getLogger(kontrollostudentet.class.getName()).log(Level.SEVERE, null, ex);
}
}