下面的代碼中記錄了錯誤行。我注意到的是,如果我突出顯示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