import java.awt.Color; public class Message { private String text; private Color color; private int counter; public Message(String t, Color c) { text = t; color = c; counter = 0; } public String getText() { counter += 1; return text; } public Color getColor() { return color; } public int getCounter() { return counter; } public String getSpacedText() { counter += 1; String spaced = ""; int i = 0; while (i < text.length()) { spaced = spaced + text.charAt(i); spaced = spaced + " "; i += 1; // just for testing: System.out.println(" DEBUG: i = " + i + ", spaced = " + spaced); } return spaced; } }