/**
* Create the frame.
* @param center Whether the frame should be centered on the monitor
* @param agentName The identifier of the Agent instance
* @param seats The seats in the environment
*/
public AgentInterface(Boolean center, String agentName, ArrayList<Seat> seats) {
name = agentName;
allSeats = seats;
initializeGUI(center, agentName);
addWindowFocusListener(new WindowFocusListener() { // NB we need a WindowFocusListener not just a FocusListener
public void windowGainedFocus(WindowEvent e) { // When focus is gained the GUI is updated because the other thread could have done something while in control.
displaySelectedSeatStatus(); // Used to update seat status text box
updateSeatPanelColors();
updateReserveAvailability();
}
@Override
public void windowLostFocus(WindowEvent arg0) {
// Must be implemented
}
});
}
AgentInterface.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:java-programs
作者:
评论列表
文章目录