Buggy code:
date_start . setHours ( tmp . getHours ( ) ) ; date_start . setMinutes ( tmp . getMinutes ( ) ) ; tmp = ( ( Date ) ( m_end_spinner . getValue ( ) ) ) ; date_end . setHours ( tmp . getHours ( ) ) ; date_end . setMinutes ( tmp . getMinutes ( ) ) ; Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( date_start ) ; Calendar cale = Calendar . getInstance ( ) ; cale . setTime ( date_end ) ; String description = CalendarPanel . m_description_field . getText ( ) ; int type = CalendarPanel . m_type_box . getSelectedIndex ( ) ; int repetition = m_repetition_box . getSelectedIndex ( ) ; int guests = new Integer ( m_guests_field . getText ( ) ) . intValue ( ) ; if ( type == ( Event . BIRTHDAY_EVENT ) ) { Data . AddBirthdayEvent ( title , cal , cale , description , repetition , guests ) ; } else if ( type == ( Event . SOCIAL_EVENT ) ) { Data . AddSocialEvent ( title , cal , cale , description , repetition , guests ) ; } else if ( type == ( Event . WORK_EVENT ) ) { Data . AddWorkEvent ( title , cal , cale , description , repetition , guests ) ; } else { Data . AddEvent ( title , cal , cale , description , repetition ) ; } m_right_panel . renderMV ( ) ; updateUI ( ) ; JOptionPane . showMessageDialog ( this , "Event<seq2seq4repair_space>saved!" , "OK!" , JOptionPane . INFORMATION_MESSAGE ) ; CalendarPanel . m_title_field . setText ( "" ) ; CalendarPanel . m_description_field . setText ( "" ) ; m_guests_field . setText ( "0" ) ; CalendarPanel . m_type_box . setSelectedIndex ( 0 ) ; m_repetition_box . setSelectedIndex ( 0 ) ; } catch ( Exception exc ) { JOptionPane err = new JOptionPane ( exc . getMessage ( ) , JOptionPane . ERROR_MESSAGE ) ; JOptionPane . showMessageDialog ( this , exc . toString ( ) , "Error" , JOptionPane . ERROR_MESSAGE ) ; Logger . getLogger ( CalendarPanel . class . getName ( ) ) . log ( Level . SEVERE , null , exc ) ; } } else if ( ( e . getSource ( ) ) == ( CalendarPanel . m_type_box ) ) { if ( ( CalendarPanel . m_type_box . getSelectedIndex ( ) ) != 0 ) { m_guests_field . setVisible ( true ) ; m_guests_label . setVisible ( true ) ; } else { m_guests_field . setVisible ( false ) ; m_guests_label . setVisible ( false ) ; } if ( ( CalendarPanel . m_type_box . getSelectedIndex ( ) ) == 3 ) { m_repetition_box . setSelectedIndex ( 8 ) ; m_repetition_box . setVisible ( false ) ; m_repetition_label . setVisible ( false ) ; } else { m_repetition_box . setVisible ( true ) ; m_repetition_label . setVisible ( true ) ; } } else if ( ( ( JButton ) ( e . getSource ( ) ) ) . getText ( ) . equals ( "edit" ) ) { int editingID = Integer . parseInt ( ( ( JButton ) ( e . getSource ( ) ) ) . getName ( ) ) ; try { Event temp = Data . GetEvents ( ) . GetEventById ( editingID ) ; m_guests_field . setVisible ( true ) ; m_guests_label . setVisible ( true ) ; if ( ( temp . m_type ) == ( Event . GENERAL_EVENT ) ) { m_guests_field . setVisible ( false ) ; m_guests_label . setVisible ( false ) ; } else if ( ( temp . m_type ) == ( Event . BIRTHDAY_EVENT ) ) { BirthdayEvent event = ( ( BirthdayEvent ) ( temp ) ) ; m_guests_field . setText ( ( "" + ( event . GetGuests ( ) ) ) ) ; } else if ( ( temp . m_type ) == ( Event . SOCIAL_EVENT ) ) { SocialEvent event = ( ( SocialEvent ) ( temp ) ) ; m_guests_field . setText ( ( "" + ( event . GetGuests ( ) ) ) ) ; } else if ( ( temp . m_type ) == ( Event . WORK_EVENT ) ) { WorkEvent event = ( ( WorkEvent ) ( temp ) ) ; <START_BUG> m_guests_field . setText ( ( "" + ( event . getGuests ( ) ) ) ) ; <END_BUG> } CalendarPanel . m_type_box . setSelectedItem ( temp . m_type ) ; CalendarPanel . m_description_field . setText ( temp . m_description ) ; m_start_spinner . setValue ( temp . m_start_date ) ; m_end_spinner . setValue ( temp . m_end_date ) ; m_repetition_box . setSelectedItem ( temp . m_repetition ) ; editing = true ; m_right_panel . renderMV ( ) ; updateUI ( ) ; } catch ( Exception ex ) { Logger . getLogger ( EventPanel . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } else if ( ( ( JButton ) ( e . getSource ( ) ) ) . getText ( ) . equals ( "del" ) ) { int id = Integer . parseInt ( ( ( JButton ) ( e . getSource ( ) ) ) . getName ( ) ) ; int reply = JOptionPane . showConfirmDialog ( this , ( "Are<seq2seq4repair_space>you<seq2seq4repair_space>" + "sure<seq2seq4repair_space>you<seq2seq4repair_space>wish<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>this<seq2seq4repair_space>event?" ) , "Confirm<seq2seq4repair_space>Delete" , JOptionPane . YES_NO_OPTION ) ; if ( reply == ( JOptionPane . YES_OPTION ) ) { try { Data . RemoveEvent ( id ) ; m_right_panel . renderMV ( ) ; updateUI ( ) ; } catch ( Exception ex ) { Logger . getLogger ( EventPanel . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } } } }

Fix:
m_guests_field . setText ( ( "" + ( event . GetGuests ( ) ) ) ) ;