Results 1 to 3 of 3
  1. #1
    dnix is offline Member
    Join Date
    Aug 2012
    Rep Power

    Default Problem with Jtable with ResultSet

    Hello Everybody:

    im new in this forum and this is my first thread, i hope you can help me, i have a problem with JTable and ResultSetScrollable, the question is that i have a JTable with AbstractTableModel, in the class AbstractTableModel, i override the three methods, getvalueat, getcolumnname....also i have a ComboBox, when i select a value of the ComboBox, the JTable shows the data associated with the ComboBox.

    Well, the problem is that JTable only shows INTEGER data, but String not, i dont know why this could be.

    if someone knows anything about this, would be very grateful.

    this is a part of the code:

    **********This is the AbstractTableModel******************************** *********
    public class PersonalTableModel extends AbstractTableModel{
    ResultSet rs;

    public PersonalTableModel(ResultSet rs) {;


    public Object getValueAt(int ri, int ci) {
    Object ob=null;




    }catch(Exception e){
    return ob;


    ************************************************** ***********
    ****This is the ItemListener for the ComboBox*******************
    public class ComboCambio implements ItemListener{
    //Recogemos en un objeto tipo ventanaprincipal la ventana principal para acceder a los controles
    VentanaPrincipal ventanaprincipal;

    public ComboCambio(VentanaPrincipal ventana){
    public void itemStateChanged(ItemEvent e) {
    PersonalTableModel pt;
    Sql sql=new Sql("BBDDChefDnix");

    Grupo g=(Grupo)ventanaprincipal.combobox.getSelectedItem ();

    pt=new PersonalTableModel(sql.getResultSetScrollable( tGrupo()));

    //Una vez tenemos el elemento del combobox actualizamos la tabla.



    ************************************************** *

    If you need more code, please tell me and i paste it.

    Thxxxxxxxxxxxxxxxxxxxx a lot!!!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Problem with Jtable with ResultSet

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. Problem with ResultSet when using GUI
    By RefugeX in forum New To Java
    Replies: 6
    Last Post: 12-01-2011, 11:21 PM
  2. Multiple Resultset in Jtable
    By hash004 in forum New To Java
    Replies: 1
    Last Post: 07-17-2011, 10:14 PM
  3. Replies: 2
    Last Post: 05-07-2011, 07:32 PM
  4. Returning a ResultSet to custom JTable Model
    By Kenjitsuka in forum New To Java
    Replies: 9
    Last Post: 10-16-2010, 10:17 PM
  5. ResultSet to JTable
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-11-2008, 10:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts