Cannot Find Symbol error

Hi,

I have the following code in 2 different classes. In 1 it works, in the other not... I cant's see why.. Any suggestions?

I get the following error:

cannot find symbol

Symbol: constructor JTable (java.lang.String,java.util.vector<java.lang.String>)

location: Clas javax.swing.JTable

The code:

import javax.swing.JTable;

import java.util.*;

import javax.swing.* ;

import java.sql.* ;

import java.awt.*;

publicclass ViewSupplierextends javax.swing.JFrame{

ControlSupplier sup =new ControlSupplier();

Vector<String> vtrColumn =new Vector<String>();

Vector<String> vtrConColumn =new Vector<String>();

/** Creates new form ViewSupplier */

public ViewSupplier(){

initComponents();

vtrColumn.add("Code");

vtrColumn.add("Supplier");

refresh();

vtrConColumn.add("Type");

vtrConColumn.add("Details");

}

//Refresh Method

publicvoid refresh(){

JTable temp =new JTable (sup.getData() , vtrColumn );

supRtrvTable.setModel(temp.getModel());

supRtrvTable.repaint();

}

//Refresh 2nd Table Method

publicvoid refreshonContacts(){

JTable contact =new JTable(sup.selectLine("" + supRtrvTable.getValueAt(supRtrvTable.getSelectedRow(), 0)), vtrConColumn);// <<<<<<<<<<<<<< The problem line....

tblContacts.setModel(contact.getModel());

tblContacts.repaint();

}

[2569 byte] By [Gil@BKKa] at [2007-11-27 10:44:13]
# 1

JTable doesn't have a constructor that accepts a String and a Vector, it does however have one that accepts a Vector and a Vector.

And why are you creating a JTable when all you're using is the model?

Why not just create the model directly?

Check out DefaultTableModel.

dwga at 2007-7-28 20:05:33 > top of Java-index,Desktop,Core GUI APIs...