下面的代码中记录了错误行。我注意到的是,如果我突出显示Customer这个词并按住Ctrl-T,它将显示Customer - SwimCalc这个正确的等级。但是,如果我做同样的承包商,它说承包商 - SwimCalc.Customer不同等级
public class SwimCalc extends JFrame implements ActionListener {
private JTabbedPane jtabbedPane;
private JPanel Customers;
private JPanel Contractors;
private List<Customer> customers = new ArrayList<Customer>();
// this fails
private List<Contractor> contractors = new ArrayList<Contractor>();
JTextArea NameTextCustomers, ExistTextCustomers, MessageTextCustomers,
NameTextContractors, ExistTextContractors, MessageTextContractors;
JTextField lengthTextPool, widthTextPool, depthTextPool, volumeTextPool;
public SwimCalc() {
setTitle("Volume Calculator");
setSize (300, 200);
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
getContentPane().add(topPanel);
createCustomers();
createContractors();
jtabbedPane = new JTabbedPane();
jtabbedPane.addTab("Customer", Customers);
topPanel.add(jtabbedPane, BorderLayout.CENTER);
}
}
那么你的问题到底是什么? – CoolBeans 2011-03-29 15:21:23
你能告诉我们'承包商'类的定义,以及你得到的确切错误信息吗? – 2011-03-29 15:22:02
@Gareth:错误:承包商无法解析为类型。你的定义是什么意思?谢谢 – Mike 2011-03-29 15:26:01