All pastes #796922 Raw Edit

Untitled

public text v1 · immutable
#796922 ·published 2007-11-25 16:01 UTC
rendered paste body
	public void setBoardDisplay(String s) 
	{
		String newString = "";
		MutableAttributeSet attribute = new SimpleAttributeSet();
		
		for (int i=0; i<s.length(); i++)
		{
			char aChar = s.charAt(i);
			newString += aChar;
			
			if (Character.isLowerCase(aChar))
			{
				StyleConstants.setForeground(attribute, Color.red);
				try 
				{ 
					doc.insertString(0, "HELLO!", attribute); 
				} catch (BadLocationException ble) { };
			}
		}
	}