/**
* Save clicked action handler
*/
private void saveButton_Clicked()
{
MileStone m = null;
try
{
m = new MileStone(Integer.parseInt(fromYearTextField.getText()),
Integer.parseInt(toYearTextField.getText()),
new MileStonePlace((String) mileStonePlaceComboBox
.getSelectedItem()),
mileStoneComboBox.getSelectedItem().toString());
((MainFrame) caller).addMileStone(m);
// JOptionPane.showMessageDialog(this, "Added successfully");
caller.setEnabled(true);
this.dispose();
}
catch (NumberFormatException e)
{
JOptionPane.showMessageDialog(this, "Bad year input");
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this, e.getMessage());
}
finally
{
if (m != null)
System.out.println(m.toString());
}
}