Added ActionListener for button in TDIDialog and fixed some errors.