private void tabelaMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
int linha = tabela.getSelectedRow();
if (linha >=0) {
txtCodigo.setText(tabela.getValueAt(linha,0).toString());
txtNome.setText(tabela.getValueAt(linha,1).toString());
//cbCor.setText(tabela.getValueAt(linha,2).toString());
txtModelo.setText(tabela.getValueAt(linha,3).toString());
txtAno.setText(tabela.getValueAt(linha,4).toString());
//cbMarca.setText(tabela.getValueAt(linha,5).toString());
txtValor.setText(tabela.getValueAt(linha,6).toString());
txtPlaca.setText(tabela.getValueAt(linha,7).toString());
txtMotor.setText(tabela.getValueAt(linha,8).toString());
//cbCombustivel.setText(tabela.getValueAt(linha,9).toString());
}
}
Por exemplo eu preciso setar o valor da linha dentro dessa combobox: //cbCor.setText(tabela.getValueAt(linha,2).toString());
Claro, a forma acima esta errada, mas como posso fazer isso?