+ /**
+ * Note: this class supports NULL as a background colour, which will revert
+ * it to its default state.
+ * <p>
+ * Note: this class' implementation will also set the main pane background
+ * colour at the same time.
+ * <p>
+ * Sets the background colour of this component. The background colour is
+ * used only if the component is opaque, and only by subclasses of
+ * <code>JComponent</code> or <code>ComponentUI</code> implementations.
+ * Direct subclasses of <code>JComponent</code> must override
+ * <code>paintComponent</code> to honour this property.
+ * <p>
+ * It is up to the look and feel to honour this property, some may choose to
+ * ignore it.
+ *
+ * @param backgroundColor
+ * the desired background <code>Colour</code>
+ * @see java.awt.Component#getBackground
+ * @see #setOpaque
+ *
+ * @beaninfo preferred: true bound: true attribute: visualUpdate true
+ * description: The background colour of the component.
+ */
+ @Override
+ public void setBackground(Color backgroundColor) {
+ this.backgroundColor = backgroundColor;
+
+ Color cme = backgroundColor == null ? backgroundColorDef
+ : backgroundColor;
+ Color cpane = backgroundColor == null ? backgroundColorDefPane
+ : backgroundColor;
+
+ if (pane != null) { // can happen at theme setup time
+ pane.setBackground(cpane);
+ }
+ super.setBackground(cme);
+ }
+
+ /**
+ * The title of this group (can be NULL for "no title", an empty
+ * {@link String} will trigger a default title for empty groups)
+ *
+ * @param title
+ * the title or NULL
+ */
+ public void setTitle(String title) {
+ if (title != null) {
+ if (title.isEmpty()) {
+ title = GuiReader.trans(StringIdGui.MENU_AUTHORS_UNKNOWN);
+ }
+
+ titleLabel.setText(String.format("<html>"
+ + "<body style='text-align: center; color: gray;'><br><b>"
+ + "%s" + "</b></body>" + "</html>", title));
+ titleLabel.setVisible(true);
+ } else {
+ titleLabel.setVisible(false);
+ }
+ }
+