Olá. pessoal!!
Foram ocorreu o erro, eu criei tabela em cada linha tem JCombobox e funcionou apareceu, mas quando seleciona o valor do JComboBox foi erro, veja a mensagem de erro em baixo
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem: The method verificaConceitos(String) in the type ModeloConceitos is not applicable for the arguments (Character)Esse linha de mensagem de erro foi indicado dentro de Modelo da tabela. veja o código que criei no dentro AbstractTableModelat ModeloConceitos.setValueAt(ModeloConceitos.java:85)
at javax.swing.JTable.setValueAt(Unknown Source)
at javax.swing.JTable.editingStopped(Unknown Source)
at javax.swing.AbstractCellEditor.fireEditingStopped(Unknown Source)
at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(Unknown Source)
at javax.swing.DefaultCellEditor$3.stopCellEditing(Unknown Source)
at javax.swing.DefaultCellEditor.stopCellEditing(Unknown Source)
at javax.swing.DefaultCellEditor$EditorDelegate.actionPerformed(Unknown Source)
at javax.swing.JComboBox.fireActionEvent(Unknown Source)
at javax.swing.JComboBox.setSelectedItem(Unknown Source)
at javax.swing.JComboBox.setSelectedIndex(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
public void setValueAt(Object value, int rowIndex, int colIndex) {
switch (colIndex) {
case 0:
al.get(rowIndex).setAtivo((Boolean) value);
break;
case 1:
al.get(rowIndex).setIdAlunos((Integer) value);
break;
case 2:
al.get(rowIndex).setNomeAluno((String) value);
break;
case 3:
System.out.println("Valor é :"+value.toString());
System.out.println("Valor do indice foram verificada: "+verificaConceitos(value.toString()));
al.get(rowIndex).setIndiceConceitos(verificaConceitos(value.toString()));
break;
}
// Para atualizar a tabela
fireTableCellUpdated(rowIndex, colIndex);
}
private int verificaConceitos(String conceitos) {
if (conceitos.equals("A")) {
return 0;
} else if (conceitos.equals("B")) {
return 1;
} else if (conceitos.equals("C")) {
return 2;
} else if (conceitos.equals("D")) {
return 3;
} else {
return 0;
}
}
public Object getValueAt(int row, int col) {
System.out.println("GetValueAT colunas: " + col + " - Linhas" + row);
switch (col) {
case 0:
return al.get(row).isAtivo();
case 1:
return al.get(row).getIdAlunos();
case 2:
return al.get(row).getNomeAluno();
case 3:
return al.get(row).getIndiceConceitos();
default:
return null;
}
}
Espero que vocês me ajuda, obrigado!!