The insertUpdate method

The insertUpdate method is shown in Listing 8.

The behavior of the insertUpdate method is essentially the same

Therefore, an explanation of the insertUpdate method should not be needed.

Listing 8. The insertUpdate method.
        public void insertUpdate(DocumentEvent e){
          try{
            redInt = Integer.parseInt(
                                   redField.getText());
            if((redInt >= 0) && (redInt <= 255)){
              paintColorSwatch();
            }//end if
          }catch(Exception ex){
            //do nothing on exception
          }//end catch
        }//end insertUpdate
        //-------------------------------------------//

      }//end new DocumentListener
    );//end addDocumentListener
File: bg.htm [Next] [Prev]