I am having problems with my observer. What I needed to do was change what was typed in the model in the observer by adding two additional chars if it is a consonant which it does. My problem is when I backspace in the model and delete char,s the observer only deletes one char instead of also deleting the chars added to the consonants. I have tried adding that if the char was also a consonant to delete the additional 2 chars added but to no avail.

 
public void update( Observable ob, Object value ) {
 
		if(ob==text)
		{
			char ch = text.getValue();
 
 
			// back space command(x08) 
			if((ch==0x08))
			{
				String s = textArea.getText();
				if(s.length() > 0)
				textArea.setText(s.substring(0,s.length()-1));
                        }
 
			// clear command(x01)
			else if(ch==0x01)
			{
 
				textArea.setText("");
 
			}
 
			else
			{
 
			// check if ch is a consonant
			if(isConsonant(ch))
			{
                            textArea.append(ch+"ut");
			}
			else
			{
                            textArea.append(ch+"");
			}
			}
 
                            textArea.repaint( );
		}
	}
 
	// return true if consontant
	private boolean isConsonant(char ch)
	{
		String consonants = "bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ";
 
		return consonants.indexOf(ch)>=0;
	}

This is the code relevant to the problem. Any help would be greatly appreciated.