JLabel label = new JLabel(d);
int newlineIndex = d.indexOf('\n'); String line; String remainder; if (newlineIndex >= 0 && newlineIndex < maxll) { line = d.substring(0, newlineIndex); remainder = d.substring(newlineIndex + 1); } else { line = d.substring(0, maxll); remainder = d.substring(maxll); } JLabel label = new JLabel(line);
  protected void burstStringInto(Container c, String d, int maxll)  {    // FIXME: Verify that this is the correct behaviour.    // One interpretation of the spec is that this method    // should recursively call itself to create (and add)     // JLabels to the container if the length of the String d    // is greater than maxll.    // but in practice, even with a really long string, this is     // all that happens.    if (d == null || c == null)      return;    JLabel label = new JLabel(d);    c.add(label);  }