Skip to main content

Problem with JTable

9 replies [Last post]
bircastri2
Offline
Joined: 2010-03-25
Points: 0

hello, i'm new for this forum. I have any problem with to create a JTable.

My Jtable takes the data from a query.

When i lunch my application i have any errors.

the code is:

<br />
import javax.swing.JFrame;<br />
import javax.swing.JPanel;<br />
import javax.swing.JScrollPane;<br />
import javax.swing.JTable;<br />
import javax.swing.table.AbstractTableModel;<br />
import javax.swing.table.DefaultTableModel;</p>
<p>import java.awt.Dimension;<br />
import java.awt.GridLayout;<br />
import java.util.Vector;</p>
<p>/**<br />
 * TableDemo is just like SimpleTableDemo, except that it<br />
 * uses a custom TableModel.<br />
 */<br />
public class TableDemo extends JPanel {<br />
    private boolean DEBUG = false;<br />
static Database db;<br />
    public TableDemo() {<br />
        super(new GridLayout(1,0));</p>
<p>        Vector c = db.eseguiQuery( "SELECT CODICE_LOCALITA, ORA_PARTENZA,ORA_ARRIVO_DA, archivionotearrivi.ABBREVIAZIONE, archivionotearrivi2.ABBREVIAZIONE FROM archiviopartenzeferiali, archiviolocalita, archivionotearrivi, archivionotearrivi2 WHERE codice_localita = archiviolocalita.codice and localita = 'Manfredonia'and  codice_1nota = archivionotearrivi.codice and codice_2nota = archivionotearrivi2.codice  ;" );</p>
<p>        MyTableModel dataModel = new MyTableModel(c);<br />
        // crea la tabella<br />
        JTable table = new JTable(dataModel);</p>
<p>        JScrollPane scrollpane = new JScrollPane(table);<br />
     // aggiunge lo ScrollPane al pannello<br />
     add(scrollpane);<br />
    }</p>
<p>    class MyTableModel extends DefaultTableModel {</p>
<p>    	Vector v = null;<br />
    	// intestazioni delle colonne<br />
    	String[] ColName = {"Titolo", "Autore",<br />
    	"Editore", "Anno" ,"Cinque"};</p>
<p>    	public MyTableModel(Vector v) {<br />
    		this.v = v; // inizializzato con il vettore<br />
    		}</p>
<p>    	public int getColumnCount()<br />
    	{ return ColName.length; }</p>
<p>    	public int getRowCount() { return v.size();}</p>
<p>    	public String getColumnName(int col) {<br />
    		return ColName[col];<br />
    		}</p>
<p>        /*<br />
         * JTable uses this method to determine the default renderer/<br />
         * editor for each cell.  If we didn't implement this method,<br />
         * then the last column would contain text ("true"/"false"),<br />
         * rather than a check box.<br />
         */<br />
        public Class getColumnClass(int c) {<br />
            return getValueAt(0, c).getClass();<br />
        }</p>
<p>        /*<br />
         * Don't need to implement this method unless your table's<br />
         * editable.<br />
         */<br />
        public boolean isCellEditable(int row, int col)<br />
        {<br />
        // nessuna cella editabile<br />
        return false;<br />
        }</p>
<p>        /*<br />
         * Don't need to implement this method unless your table's<br />
         * data can change.<br />
         */</p>
<p>    }</p>
<p>    /**<br />
     * Create the GUI and show it.  For thread safety,<br />
     * this method should be invoked from the<br />
     * event-dispatching thread.<br />
     */<br />
    private static void createAndShowGUI() {<br />
        //Create and set up the window.<br />
        JFrame frame = new JFrame("TableDemo");<br />
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);</p>
<p>        //Create and set up the content pane.<br />
        TableDemo newContentPane = new TableDemo();<br />
        newContentPane.setOpaque(true); //content panes must be opaque<br />
        frame.setContentPane(newContentPane);</p>
<p>        //Display the window.<br />
        frame.pack();<br />
        frame.setVisible(true);<br />
    }</p>
<p>    public static void main(String[] args) {<br />
        //Schedule a job for the event-dispatching thread:<br />
        //creating and showing this application's GUI.<br />
        javax.swing.SwingUtilities.invokeLater(new Runnable() {<br />
            public void run() {<br />
                inizializzaDatabase();<br />
            	createAndShowGUI();<br />
            }<br />
        });<br />
    }</p>
<p>    private static void inizializzaDatabase() {<br />
		// TODO Auto-generated method stub<br />
		db = new Database("partenzearrivi");<br />
	    if ( !db.connetti() ) {<br />
	       System.out.println("Errore durante la connessione al database ");<br />
	       System.out.println( db.getErrore() );<br />
	       System.exit(0);<br />
	    }<br />
	    else{<br />
	    	System.out.println("Mi sono connesso");<br />
	    }<br />
	}//fi<br />
}<br />

and the errors are

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at TableDemo$MyTableModel.getRowCount(TableDemo.java:49)
at javax.swing.table.DefaultTableModel.setDataVector(Unknown Source)
at javax.swing.table.DefaultTableModel.(Unknown Source)
at javax.swing.table.DefaultTableModel.(Unknown Source)
at javax.swing.table.DefaultTableModel.(Unknown Source)
at TableDemo$MyTableModel.(TableDemo.java:42)
at TableDemo.(TableDemo.java:25)
at TableDemo.createAndShowGUI(TableDemo.java:97)
at TableDemo.access$1(TableDemo.java:91)
at TableDemo$1.run(TableDemo.java:112)
at java.awt.event.InvocationEvent.dispatch(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)

what is the problem???

can you help me????

Regards

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bircastri2
Offline
Joined: 2010-03-25
Points: 0

Hi, i have change my code in this mode:

[code]
public TableDemo() {

super(new GridLayout(1,0));
Object[] Localita = db.eseguiQuery("SELECT Localita FROM archiviolocalita").toArray();
String citta = Localita[0].toString();
citta = elimina_caratteri(citta);
Vector v = db.eseguiQuery( "SELECT CODICE_LOCALITA, ORA_PARTENZA,ORA_ARRIVO_DA, archivionotearrivi.ABBREVIAZIONE, archivionotearrivi2.ABBREVIAZIONE FROM archiviopartenzeferiali, archiviolocalita, archivionotearrivi, archivionotearrivi2 WHERE codice_localita = archiviolocalita.codice and localita = '"+ citta+"'and codice_1nota = archivionotearrivi.codice and codice_2nota = archivionotearrivi2.codice ;" );
MyTableModel dataModel = new MyTableModel(v);
JTable table = new JTable(dataModel);
JScrollPane scrollpane = new JScrollPane(table);
add(scrollpane);
for (int con =1; con<4; con++)
{

citta = Localita[con].toString();
citta = elimina_caratteri(citta);
v = db.eseguiQuery( "SELECT CODICE_LOCALITA, ORA_PARTENZA,ORA_ARRIVO_DA, archivionotearrivi.ABBREVIAZIONE, archivionotearrivi2.ABBREVIAZIONE FROM archiviopartenzeferiali, archiviolocalita, archivionotearrivi, archivionotearrivi2 WHERE codice_localita = archiviolocalita.codice and localita = '"+ citta+"'and codice_1nota = archivionotearrivi.codice and codice_2nota = archivionotearrivi2.codice ;" );
table.setModel(new MyTableModel(v));
System.out.println("La città è: "+ citta);
System.out.println(v);
}

}
[/code]

With the cycle for the vector v is correctly inizializate, but i don't know how to stop the cycle for any seconds

theface
Offline
Joined: 2005-09-18
Points: 0

I don't know what do you want.

[code]
public TableDemo() {
super(new GridLayout(1,0));
Object[] Localita = db.eseguiQuery("SELECT Localita FROM archiviolocalita").toArray();
Vector v = new Vector(0);
MyTableModel dataModel = new MyTableModel(v);
JTable table = new JTable(dataModel);
JScrollPane scrollpane = new JScrollPane(table);
add(scrollpane);
for (int con =0; con<4/*or Localita.length*/; con++)
{
String citta = Localita[0].toString();
citta = elimina_caratteri(citta);
v = db.eseguiQuery( "SELECT CODICE_LOCALITA, ORA_PARTENZA,ORA_ARRIVO_DA, archivionotearrivi.ABBREVIAZIONE, archivionotearrivi2.ABBREVIAZIONE FROM archiviopartenzeferiali, archiviolocalita, archivionotearrivi, archivionotearrivi2 WHERE codice_localita = archiviolocalita.codice and localita = '"+ citta+"'and codice_1nota = archivionotearrivi.codice and codice_2nota = archivionotearrivi2.codice ;" );
dataModel.setRowCount(0);
dataModel.fireTableStructureChanged() ;
for(Object itm:v)
dataModel.addRow(itm);//itm must be cast as type Vector or Object[].
System.out.println("La città è: "+ citta);
System.out.println(v);
//if you want to wait some times:
//Thread.sleep(times in millisecond );

//if you want this loop always running until system exit:
//if(con>=4)con=0;//or con>=Localita.length;
}
}
[/code]

In actually,you need to lean more technique about programming in java.

bircastri2
Offline
Joined: 2010-03-25
Points: 0

ok, i have result my problem

[code]
public Object getValueAt(int row, int col) {
//Object rowVal = v.get(row);
//return((Object[])rowVal)[col];//[col];
Vector riga = (Vector)v.elementAt(row);
Object colonna = riga.elementAt(col);
return colonna;

}
[/code]

but i have another questions.

I must change every 5000 seconds i content of my table.

Every 5000 seconds i lunch a query and the result of the vector v is changed.

How i change this and the table change the content???

theface
Offline
Joined: 2005-09-18
Points: 0

you can just use dataModel to do something:
1)clear data,
dataModel.setRowCount(0).
dataModel.fireTableDataChanged().

2)fill dataModel use your queried new datas in vector.
dataModel.addRow...

bircastri2
Offline
Joined: 2010-03-25
Points: 0

I have change my code and method getValueAt in

[code]
public Object getValueAt(int row, int col) {
Object rowVal = v.get(row);
return((Object[])rowVal)[col];

}
[/code]

but when i start my application i have any errors:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.util.Vector cannot be cast to [Ljava.lang.Object;
at TableDemo$MyTableModel.getValueAt(TableDemo.java:81)
at TableDemo$MyTableModel.getColumnClass(TableDemo.java:66)
at javax.swing.JTable.getColumnClass(Unknown Source)
at javax.swing.JTable.getCellRenderer(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at java.awt.Window.paint(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.util.Vector cannot be cast to [Ljava.lang.Object;
at TableDemo$MyTableModel.getValueAt(TableDemo.java:81)
at TableDemo$MyTableModel.getColumnClass(TableDemo.java:66)
at javax.swing.JTable.getColumnClass(Unknown Source)
at javax.swing.JTable.getCellRenderer(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at java.awt.Window.paint(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.util.Vector cannot be cast to [Ljava.lang.Object;
at TableDemo$MyTableModel.getValueAt(TableDemo.java:81)
at TableDemo$MyTableModel.getColumnClass(TableDemo.java:66)
at javax.swing.JTable.getColumnClass(Unknown Source)
at javax.swing.JTable.getCellRenderer(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at java.awt.Window.paint(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.util.Vector cannot be cast to [Ljava.lang.Object;
at TableDemo$MyTableModel.getValueAt(TableDemo.java:81)
at TableDemo$MyTableModel.getColumnClass(TableDemo.java:66)
at javax.swing.JTable.getColumnClass(Unknown Source)
at javax.swing.JTable.getCellRenderer(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at java.awt.Window.paint(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)

bircastri2
Offline
Joined: 2010-03-25
Points: 0

I have change the code.

I have chage DefaultTableModel to AbstractTableModel and i have implements method getValueAt()....

the method is:

[code]
public Vector getValueAt(int row, int col) {
return v = db.eseguiQuery( "SELECT CODICE_LOCALITA, ORA_PARTENZA,ORA_ARRIVO_DA, archivionotearrivi.ABBREVIAZIONE, archivionotearrivi2.ABBREVIAZIONE FROM archiviopartenzeferiali, archiviolocalita, archivionotearrivi, archivionotearrivi2 WHERE codice_localita = archiviolocalita.codice and localita = 'Manfredonia'and codice_1nota = archivionotearrivi.codice and codice_2nota = archivionotearrivi2.codice ;" );

}
[/code]

now the table is created but the result of all vector is insert into every cell and in every row and col

theface
Offline
Joined: 2005-09-18
Points: 0

Oh..problem founded.you can try change the method getRowCount to:

public int getRowCount() { return null==v?0:v.size();}

Because when you create MyTableModel,it will invoke super constructor at first.at this time,the var v has not initiated.

If your datas store in v,the getValueAt method should be like this:

public Vector getValueAt(int row, int col) {
Object rowVal = v.get(row);
//for array
return ((Object[])rowVal)[col];//or change to you owner type.
}

bircastri2
Offline
Joined: 2010-03-25
Points: 0

Yes, if i write System.out.println(v), the application print all element in the vector correctly.

i think the problem is DefaultTableModel. I must change to AbstractTableModel, but i don't implements the method getValueAt(int row, int column)

theface
Offline
Joined: 2005-09-18
Points: 0

Hey.In your case,the error is java.lang.NullPointerException ,at TableDemo$MyTableModel.getRowCount(TableDemo.java:49), your code:
public int getRowCount() { return v.size();}
it means the var v is null.

are you sure db.eseguiQuery returned vector has value?