Timestamp l_Timestamp = timestampField.getTimestamp(); Calendar l_Calendar = Calendar.getInstance(); l_Calendar.setTimeInMillis(l_Timestamp.getTime()); l_Calendar.add(Calendar.DATE, -1); timestampField.setTimestamp(new Timestamp(l_Calendar.getTimeInMillis()));
if (timestampField.isValid()) { Timestamp l_Timestamp = timestampField.getTimestamp(); Calendar l_Calendar = Calendar.getInstance(); l_Calendar.setTimeInMillis(l_Timestamp.getTime()); l_Calendar.add(Calendar.DATE, -1); timestampField.setTimestamp(new Timestamp(l_Calendar.getTimeInMillis())); }
		public void eventAction(Component a_Component)		{			if(a_Component==increaseNumberButton)			{				numberField.setInt(numberField.getInt() + 1);			}			else if(a_Component==decreaseNumberButton)			{				numberField.setInt(numberField.getInt() - 1);			}				else if(a_Component==tomorrowButton)			{				Timestamp l_Timestamp = timestampField.getTimestamp();				Calendar l_Calendar = Calendar.getInstance();				l_Calendar.setTimeInMillis(l_Timestamp.getTime());				l_Calendar.add(Calendar.DATE, 1);				timestampField.setTimestamp(new Timestamp(l_Calendar.getTimeInMillis()));			}			else if(a_Component==yesterdayButton)			{				Timestamp l_Timestamp = timestampField.getTimestamp();				Calendar l_Calendar = Calendar.getInstance();				l_Calendar.setTimeInMillis(l_Timestamp.getTime());				l_Calendar.add(Calendar.DATE, -1);				timestampField.setTimestamp(new Timestamp(l_Calendar.getTimeInMillis()));							}			else if(a_Component==nextMonthButton)			{				Timestamp l_Timestamp = timestampField.getTimestamp();				Calendar l_Calendar = Calendar.getInstance();				l_Calendar.setTimeInMillis(l_Timestamp.getTime());				l_Calendar.add(Calendar.MONTH, 1);				timestampField.setTimestamp(new Timestamp(l_Calendar.getTimeInMillis()));				}			else if(a_Component==previousMonthButton)			{				Timestamp l_Timestamp = timestampField.getTimestamp();				Calendar l_Calendar = Calendar.getInstance();				l_Calendar.setTimeInMillis(l_Timestamp.getTime());				l_Calendar.add(Calendar.MONTH, -1);				timestampField.setTimestamp(new Timestamp(l_Calendar.getTimeInMillis()));							}			else if(a_Component==deleteSelectedFromTableButton)			{				table.deleteSelectedRows();			}			else if(a_Component==numberToTableButton)			{				if(numberField.isValid())				{					SimpleTableModel l_SimpleTableModel= (SimpleTableModel)table.getTableModel();					l_SimpleTableModel.addValue(numberField.getText());													}			}			else if(a_Component==timestampToTableButton)			{				if(timestampField.isValid())				{					SimpleTableModel l_SimpleTableModel= (SimpleTableModel)table.getTableModel();					l_SimpleTableModel.addValue(timestampField.getText());													}			}			else if(a_Component==textToTableButton)			{				if(textToTableButton.isValid())				{					SimpleTableModel l_SimpleTableModel= (SimpleTableModel)table.getTableModel();					l_SimpleTableModel.addValue(textField.getText());					}						}		}