当我尝试使用下面的代码时,列表中没有填充特定的数组,请帮助我在netbeans中编写GUI代码
private void bookingListJCBActionPerformed(java.awt.event.ActionEvent evt) {
for(int i = 0;i<dataSource.getBookingList().size();i++){
Bookings tempBooking = dataSource.getBookingList().get(i);
boolean tempFinish = tempBooking.getFinish();
String tempMechanic = tempBooking.getMechanic();
String tempClerk = tempBooking.getClerk();
String tempService = tempBooking.getService();
if(tempFinish == true){
bookingListJCB.addItem(tempBooking);
mechanicJTF.setText(tempMechanic);
seriveceClerkJTF.setText(tempMechanic);
serviceJTF.setText(""+tempService );
finishJTF.setText(""+tempFinish);
}
}
// TODO add your handling code here:
}
以下是预订课程,我不知道为什么组合框没有显示任何内容
public class Bookings {
private String vehicle;
private String clerk;
private String service;
private String mechanic;
private boolean finish;
public Bookings() {
}
public Bookings(String vehicle, String clerk, String service, String mechanic, boolean finish) {
this.vehicle = vehicle;
this.clerk = clerk;
this.service = service;
this.mechanic = mechanic;
this.finish = finish;
}
public String getVehicle() {
return vehicle;
}
public void setVehicle(String vehicle) {
this.vehicle = vehicle;
}
public String getClerk() {
return clerk;
}
public void setClerk(String clerk) {
this.clerk = clerk;
}
public String getService() {
return service;
}
public void setService(String service) {
this.service = service;
}
public String getMechanic() {
return mechanic;
}
public void setMechanic(String mechanic) {
this.mechanic = mechanic;
}
public boolean getFinish() {
return finish;
}
public void setFinish(boolean finish) {
this.finish = finish;
}
@Override
public String toString() {
return "Bookings{" + "vehicle=" + vehicle + ", clerk=" + clerk + ", service=" + service + ", mechanic=" + mechanic + ", finish=" + finish + '}';
}
}