JButton, QButtonUI Demo

What Is It

This demo features JButton configuration options and new QButtonUI implementations.

How To Use It

Use the "Configuration" panel to control the buttons in the "Example" panel.

The 5 QButtonUIs can be installed by calling:

button.setUI(new BevelButtonUI());
button.setUI(new GradientButtonUI());
button.setUI(new RecessedButtonUI());
button.setUI(new RoundRectButtonUI());
button.setUI(new SquareButtonUI());

All configuration controls have specific tooltips that describe what property they define.

How It Works

AquaButtonUI

If you're viewing this on Mac: the default ButtonUI is the AquaButtonUI. This demo shows off 3 special features of the AquaButtonUI:

QButtonUI

This demo also includes five new UIs: BevelButtonUI, GradientButtonUI, RecessedButtonUI, RoundRectButtonUI, SquareButtonUI. These are all subclasses of the abstract QButtonUI class. QButtonUI subclasses include the following options:

There is no "size variant" option, but you can manually change the corner radius size and font size of buttons tweak the size.

QButtonUIs are vector-based, so if you render them on high-resolution monitors or otherwise change their size they should scale well.