private static Date raidDate(Bombed bombed) {
    final Calendar instance = Calendar.getInstance();
    instance.set(Calendar.YEAR, bombed.year());
    instance.set(Calendar.MONTH, bombed.month());
    instance.set(Calendar.DAY_OF_MONTH, bombed.day());
    instance.set(Calendar.HOUR_OF_DAY, bombed.time());
    instance.set(Calendar.MINUTE, 0);

    return instance.getTime();
  }
 public void actionPerformed(ActionEvent a) {
   int monthNum = month.getSelectedIndex();
   int dayNum = Integer.parseInt(day.getText());
   int yearNum = Integer.parseInt(year.getText());
   Calendar c = Calendar.getInstance();
   c.set(Calendar.MONTH, monthNum);
   c.set(Calendar.DAY_OF_MONTH, monthNum);
   c.set(Calendar.YEAR, yearNum);
   Date date = c.getTime();
   String dayOfWeek = (new SimpleDateFormat("EEE")).format(date);
   outputLabel.setText(dayOfWeek);
 }
  /**
   * DOCUMENT ME!
   *
   * @param evt DOCUMENT ME!
   */
  private void btnThisMonthActionPerformed(final java.awt.event.ActionEvent evt) {
    final Calendar calendar = Calendar.getInstance();

    final Date toDate = calendar.getTime();

    calendar.set(Calendar.DAY_OF_MONTH, 1);
    final Date fromDate = calendar.getTime();

    try {
      lockDateButtons = true;
      dpiFrom.setDate(fromDate);
      dpiTo.setDate(toDate);
    } finally {
      lockDateButtons = false;
    }

    periodChanged();
    refreshFortfuehrungsList();
  }
Exemplo n.º 4
0
 private void recordMofifTime() {
   Calendar c = new GregorianCalendar();
   c.setTime(new Date());
   c.set(Calendar.MINUTE, c.get(Calendar.MINUTE) + 1);
   c.set(Calendar.SECOND, 0);
 }