code: private String getPlaceholderText(Graphics g, int availTextWidth) {
          JTextComponent c  = getComponent();
          FontMetrics    fm = SwingUtilities2.getFontMetrics(c, g);
  
          return SwingUtilities2.clipStringIfNecessary(c, fm, placeholderText, availTextWidth);
      }
docs: Get the placeholder text, clipped if necessary.
  
  @param  g              fm the font metrics to compute size with.
  @param  availTextWidth the available space to display the title in.
  
  @return the text, clipped to fit the available space.