Esempio n. 1
0
  /**
   * Updates the UIs for the labels in the label table by calling {@code updateUI} on each label.
   * The UIs are updated from the current look and feel. The labels are also set to their preferred
   * size.
   *
   * @see #setLabelTable
   * @see JComponent#updateUI
   */
  protected void updateLabelUIs() {
    Dictionary labelTable = getLabelTable();

    if (labelTable == null) {
      return;
    }
    Enumeration labels = labelTable.keys();
    while (labels.hasMoreElements()) {
      JComponent component = (JComponent) labelTable.get(labels.nextElement());
      component.updateUI();
      component.setSize(component.getPreferredSize());
    }
  }