private void countCharacters() { int characters = DescriptionTextBox.getText().length(); int remaining = descriptionLimit - characters; CharacterLimit.setText(remaining + "/" + descriptionLimit); if (remaining <= 0) { CharacterLimit.setForeground(Color.red); } else if (remaining > 0) { CharacterLimit.setForeground(Color.BLACK); } }