Пример #1
0
 @Override
 // 设置窗口显示模式
 protected void processWindowEvent(WindowEvent e) {
   super.processWindowEvent(e);
   if (e.getID() == WindowEvent.WINDOW_CLOSING) {
     switch (getDefaultCloseOperation()) {
       case HIDE_ON_CLOSE:
         setVisible(false);
         MainFrame.getMainFrame().cancelShowNear();
         MainFrame.getMainFrame().cancelShowFocusNearPoint();
         break;
       case DISPOSE_ON_CLOSE:
         dispose();
         break;
       case DO_NOTHING_ON_CLOSE:
       default:
         break;
       case EXIT_ON_CLOSE:
         // This needs to match the checkExit call in
         // setDefaultCloseOperation
         System.exit(0);
         break;
     }
   }
 }
Пример #2
0
  public void begin() {
    frame = MainFrame.getMainFrame();

    ArrayList<ResponseInfo> infos = new ArrayList<ResponseInfo>();

    for (int i = TYPE.DEFAULT.ordinal(); i <= (TYPE.CAR_OTHEN_OVER_NIGHTS.ordinal()); i++) {
      ResponseInfo info = new ResponseInfo();
      info.setRes_id(TYPE.values()[i]);
      info.setIn_out("in");
      info.setData(Integer.toString(i));
      infos.add(info);
    }

    for (ResponseInfo info : infos) {
      System.out.println(info.getRes_id());
      System.out.println(info.getIn_out());
      System.out.println(info.getData());
      System.out.println("-----------");
      frame.onReceiveMsg(info);
    }
  }
Пример #3
0
 public CInstead() {
   icon =
       new ImageIcon(MainFrame.getMainFrame().getClass().getResource("/res/FindHelpList.jpg"));
   img = icon.getImage();
 }