Pegar dado de um Calendar selecionado por uma table

0 respostas
java
felipe1234

Pessoal bom dia estou querendo pegar o dado de um calendar selecionado de acordo com o JTableMouseClicked e colocá-lo em um textField.Mas apresenta o seguinte erro java.lang.NullPointerExeception:

O codigo que colequei dentro do evento JTableMouseClicked foi:

int fila = jTableProdutos.rowAtPoint(evt.getPoint());
    jTableProdutos.setSelectionBackground(Color.BLUE);
    txtId.setText(jTableProdutos.getValueAt(fila, 0).toString());
    txtNomeProduto.setText(jTableProdutos.getValueAt(fila, 1).toString());
   jDateChooser1.setDate(Date.valueOf(jTableProdutos.getValueAt(fila, 2).toString()));
    txtTotal.setText(jTableProdutos.getValueAt(fila, 2).toString());
    txtPreco.setText(jTableProdutos.getValueAt(fila, 3).toString());
    txtIPE.setText(jTableProdutos.getValueAt(fila, 4).toString());
   buttonGroup1.setSelected(jTableProdutos.getValueAt(fila, 6).toString());
    txtICMS.setText(jTableProdutos.getValueAt(fila, 5).toString());
    txtPeso.setText(jTableProdutos.getValueAt(fila, 6).toString());
    txtEstado.setText(jTableProdutos.getValueAt(fila, 7).toString());
   txtmarca.setText(jTableProdutos.getValueAt(fila, 8).toString());
    txtTamanho.setText(jTableProdutos.getValueAt(fila, 9).toString());
Criado 27 de janeiro de 2017
Respostas 0
Participantes 1