Substance client properties

View all API methods.

View all client properties.

Client property name



Client property name for specifying the corner radius for buttons. Currently, this property is respected only on toolbar buttons. This property can be set either as a client property on a specific toolbar button, a client property on a specific toolbar (will hold for all buttons in the toolbar) or as a global setting on UIManager. The value should be a Float instance.

See also

Sample code

import java.awt.BorderLayout;

import javax.swing.*;

import org.pushingpixels.substance.api.SubstanceLookAndFeel;

 * Test application that shows the use of the
 {@link SubstanceLookAndFeel#CORNER_RADIUS} client property.
 @author Kirill Grouchnikov
 @see SubstanceLookAndFeel#CORNER_RADIUS
public class CornerRadius extends JFrame {
   * Creates the main frame for <code>this</code> sample.
  public CornerRadius() {
    super("Toolbar button corner radius");

    this.setLayout(new BorderLayout());

    JToolBar toolBar = new JToolBar("");
    toolBar.add(new JLabel("Sample toolbar"));
    toolBar.add(new JSeparator(SwingConstants.VERTICAL));

    JToggleButton buttonDefault = new JToggleButton("radius default");

    JToggleButton button1 = new JToggleButton("radius 5");
    // set corner radius to 5 pixels
    button1.putClientProperty(SubstanceLookAndFeel.CORNER_RADIUS, Float

    JToggleButton button2 = new JToggleButton("radius 0");
    // set corner radius to 0 pixels (perfect rectangle)
    button2.putClientProperty(SubstanceLookAndFeel.CORNER_RADIUS, Float

    this.add(toolBar, BorderLayout.NORTH);


   * The main method for <code>this</code> sample. The arguments are ignored.
   @param args
   *            Ignored.
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        SubstanceLookAndFeel.setSkin(new BusinessBlackSteelSkin());
        new CornerRadius().setVisible(true);

The screenshot below shows application frame with three tollbar buttons. The left button has default radius, while the middle and the right buttons have custom radius.