# Substance client properties

View all API methods.

View all client properties.

Client property name | SubstanceLookAndFeel.SHOW_EXTRA_WIDGETS

Description | Property name for specifying that extra UI elements (such as menu items in system menu or lock borders) should be shown. This property can be set as a global setting on `UIManager` or as a client property on a specific component. The value should be either `Boolean.TRUE` or `Boolean.FALSE`.

See also |

Sample code | `import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*;
import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel;
/**
* Test application that shows the use of the
* {@link SubstanceLookAndFeel#SHOW_EXTRA_WIDGETS} client property.
*
* @author Kirill Grouchnikov
* @see SubstanceLookAndFeel#SHOW_EXTRA_WIDGETS
*/
public class ShowExtraWidgets extends JFrame {
/**
* Creates the main frame for <code>this</code> sample.
*/
public ShowExtraWidgets() {
super("Show extra widgets");
this.setLayout(new BorderLayout());
JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT));
final JCheckBox showExtraWidgets = new JCheckBox("show extra widgets");
showExtraWidgets.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
// based on the checkbox selection status, set the
// property
UIManager.put(SubstanceLookAndFeel.SHOW_EXTRA_WIDGETS,
Boolean.valueOf(showExtraWidgets.isSelected()));
SwingUtilities
.updateComponentTreeUI(ShowExtraWidgets.this);
}
});
}
});
controls.add(showExtraWidgets);
this.add(controls, BorderLayout.SOUTH);
JPanel centerPanel = new JPanel(new FlowLayout());
JTextField readOnlyTextField = new JTextField("read-only");
readOnlyTextField.setEditable(false);
centerPanel.add(readOnlyTextField);
this.add(centerPanel, BorderLayout.CENTER);
this.setSize(400, 200);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
/**
* The main method for <code>this</code> sample. The arguments are
* ignored.
*
* @param args
* Ignored.
* @throws Exception
* If some exception occured. Note that there is no special
* treatment of exception conditions in <code>this</code>
* sample code.
*/
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
JFrame.setDefaultLookAndFeelDecorated(true);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new ShowExtraWidgets().setVisible(true);
}
});
}
}`

The screenshot below shows an uneditable text field when this property is not set:

The screenshot below shows system menu when this property is set to `Boolean.TRUE`. Note the lock icon in the bottom-left corner of the text field: