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();
}

