17/01/2012, 20:29
|
| | Fecha de Ingreso: mayo-2011
Mensajes: 7
Antigüedad: 13 años, 6 meses Puntos: 0 | |
Ayudaa pasar datos de un jtable a cajas de texto Buenas Noches Foro
Ayudenme Porfas ... mi Consulta es la siguiente tengo un proyecto el cual esta enlazado a una BD en MySQL ... se carga esos datos una Tabla y de esa tabla segun que fila seleccione presionar un boton y pasar los datos a sus respectivas cajas de texto que se encuentra en el applet ..
El codigo que investigando encontre para cojer los datos y pasarlo a las cajas de texto es el sgte
void CargarDatosTabla (){
Integer id = (Integer)tablaCliente.getValueAt(tablaCliente.getS electedRow(), 0);
txtCodigoPMC.setText(Integer.toString(id));
txtNombrePMC.setText(Integer.toString(id));
txtApellidoPMC.setText(Integer.toString(id));
txtTelefonoPMC.setText(Integer.toString(id));
txtLicenciaPMC.setText(Integer.toString(id));
}
y me sale el siguiente Error u.u
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
at Paneles.Cliente.CargarTablaModificar(Cliente.java: 356)
at Paneles.Cliente.actionPerformed(Cliente.java:185)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.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(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn 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.doIntersectio nPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(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.doIntersectio nPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
______________________________
Estoy que me rompo la cabeza con esto porque no me sale y me estrese un poco Por favor ayuda
Gracias a todos
Última edición por mlvm_1392; 17/01/2012 a las 20:39 |