错误行在下面的代码中注明。我注意到的一点是,如果我突出显示单词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);
}
}
答案 0 :(得分:1)
错误“承包商无法解析为某种类型”可能意味着
class Contractor {...}
Contractor