void replace(DocumentFilter.FilterBypass fb,int offset,int length,String string,AttributeSet attr) throws BadLocationException {
  if (!getAllowsInvalid() && length == 0 && string != null && string.length() == 1 && toggleSignIfNecessary(fb,offset,string.charAt(0))) {
    return;
  }
  super.replace(fb,offset,length,string,attr);
}

void replace ( DocumentFilter . FilterBypass fb , int offset , int length , String string , AttributeSet attr ) throws BadLocationException { if ( ! getAllowsInvalid ( ) && length == 0 && string != null && string . length ( ) == 1 && toggleSignIfNecessary ( fb , offset , string . charAt ( 0 ) ) ) { return ; } super . replace ( fb , offset , length , string , attr ) ; }
overriden to toggle the value if the positive / minus sign is inserted .
