void updateTheLabel(DocumentEvent e) {
   Document doc = (Document) e.getDocument();
   String text = null;
   try {
     text = doc.getText(0, doc.getLength());
     doc = null;
   } catch (BadLocationException ex) {
     text = null;
   }
   if (text != null) {
     try {
       double number = Double.parseDouble(text);
       if (number > 1) {
         label.setText(labelPair.getPlural());
       } else {
         label.setText(labelPair.getSingular());
       }
     } catch (NumberFormatException ex) {
       // Do nothing
     } finally {
       text = null;
     }
   }
 }