Cannot resolve symbol

1 resposta
J
[b]Estou com problemas: mensagem de erro

Principal.java:302: cannot resolve symbol

symbol  : class EmployeeDataModel

location: class Principal

EmployeeDataModel employeeModel = new EmployeeDataModel();

^

Principal.java:302: cannot resolve symbol

symbol  : class EmployeeDataModel

location: class Principal

EmployeeDataModel employeeModel = new EmployeeDataModel();

^

2 errors :?:

o trecho do programa:[/b]

jPainelJTable.setLayout (new BorderLayout());

EmployeeDataModel employeeModel = new EmployeeDataModel();

JTable table = new JTable (employeeModel);			JScrollPane scrollPane = new JScrollPane (table);

jPainelJTable.add(scrollPane, BorderLayout.CENTER);
[list]a outra classe - esta compilada e no mesmo diretorio:[/list]import javax.swing.*;

import javax.swing.table.AbstractTableModel;

public class EmployeeDataModel extends AbstractTableModel {

// By extending AbstractTableModel, instead of
// implementing TableModel yourself,
// AbstractTableModel takes care of
// TableModelListener list management

String columns[] = {“Employee ID”, “First Name”,

“Last Name”, “Department”};

String rows[][] = {

{“0181”, “Bill”, “Cat”, “Political Candidate”},

{“0915”, “Opus”, “Penguin”, “Lost and Found”},

{“1912”, “Milo”, “Bloom”, “Reporter”},

{“3182”, “Steve”, “Dallas”, “Legal”},

{“4104”, “Hodge”, “Podge”, “Style”},

{“5476”, “Billy”, “Boinger”, “Entertainment”},

{“6289”, “Oliver”, “Jones”, “Science”},

{“7268”, “Cutter”, “John”, “Travel”},

{“8133”, “W. A.”, “Thornhump”, “C.E.O”},

{“9923”, “Berke”, “Breathed”, “Editor”}

};

private int numColumns = columns.length;
private int numRows = rows.length;

public int getColumnCount() {

return numColumns;

}
public int getRowCount() {

return numRows;

}
public Object getValueAt (int row, int column) {

return rows[row][column];

}
public String getColumnName (int columnIndex) {

return columns[columnIndex];

}
public void setValueAt (Object aValue,

int row, int column) {

String cellValue;

if (aValue instanceof String)

cellValue = (String)aValue;

else

cellValue = aValue.toString();

rows[row][column] = cellValue;

fireTableCellUpdated (row, column);

}
public boolean isCellEditable(int row, int column) {

// first column is read-only

return (column != 0);

}

}

1 Resposta

Claire

Verifique o import da classe…

Criado 20 de janeiro de 2004
Ultima resposta 20 de jan. de 2004
Respostas 1
Participantes 2