【发布时间】:2015-08-25 11:27:28
【问题描述】:
有人能告诉我为什么我不能正确使用 Set 吗?我设法使用 Get 在文本框中加载姓名、姓氏等,但 Set 不允许我从文本框中读取并保存它们。谢谢
custnameTF.setText(bookingfile.getCustomer().getPersonName());
custsurnameTF.setText(bookingfile.getCustomer().getPersonSurname());
customerbooking.setCustomer(.setPersonName(custnameTF.getText));
public class Booking implements Serializable{
private String flighttime;
private String flightlocation;
private String flightfee;
private boolean car;
private boolean insurance;
private Customer customer;
我正在尝试将 2 个类连接在一起而无需扩展。我想通过 Booking 类加载和保存 Customer 类。谢谢
【问题讨论】:
-
(.setPersonName(custnameTF.getText));它不会编译。请更正您的问题并提供更多详细信息,因为几乎不可能猜到。