public void pressbutton() {
 Timetable_main_RWRAF.read(Homework_database_edit_1.getn());
    
int ID = (Timetable_main_RWRAF.getID());
String subject = (String)Subject.getSelectedItem();
String desc = DescField.getText();
String difficulty = (String)DiffField.getSelectedItem();
int time = Integer.parseInt((String)Timef1.getSelectedItem());

if(desc.length() < 501)
{

int delete = Timetable_main_RWRAF.checkDelete();

edit(ID, subject, desc, difficulty, time, delete);

this.setVisible(false);       
}
else
{
  JOptionPane.showMessageDialog(null,"Your description is too big, please cut it to 500 words.", "Timetable Management Program", JOptionPane.INFORMATION_MESSAGE);
}
        
}