/** * Enclose a string in HTML paragraph indicators, optionally with a color. And repaint the label * so it shows up. This is "package-private" because, since the anonymous inner class below needs * it, we can't make it private. If no color is specified, we'll make it white, because the * label's background color is black. * * @param paragraph the string to enclose * @param color the color to make it, or the empty string if none. */ private void printParagraph(final String paragraph, final StreamingLabel.LabelTextColor color) { try (final PrintWriter writer = label.getWriter()) { // This is safe because StringWriter.close() does nothing. writer.print("<p style=\"color:"); writer.print(color); writer.print("\">"); writer.print(paragraph); writer.println("</p>"); } // At one point we called updateText on the label. label.repaint(); }
/** @return a diagnostic String */ @Override public String toString() { return "MapCheckerFrame showing: " + label.getText(); }