private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
  
  String subjectchosen = (String)Subject.getSelectedItem();
  String descchosen = DescField.getText();
  String diffchosen = (String)DiffField1.getSelectedItem();
  String timechosenstring = (String)Timef1.getSelectedItem();
  if(descchosen.length() < 501)
  {
  
  int timechoseninteger = Integer.parseInt(timechosenstring);
  
    
Homework_database homework = new Homework_database(subjectchosen, descchosen, diffchosen, timechoseninteger);
List_Homework_database List = new List_Homework_database();
int size = List.size();
List.add(homework, size+1);
Timetable_main_RWRAF.write(homework);


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

  }
        
}//GEN-LAST:event_jButton1MouseClicked