Search
Appearance

Keyboard appearance

The Stretch property specifies how the keyboard layout fills the available space of the Java Swing component. The default value is Uniform, specifying that the keyboard's content stretches uniformly to fill either the width or height of parent, depending on current aspect ratio. The background of the keyboard is painted using JComponent's standard Background property, as long as current Theme is not specifying background brush.

Customize keys

The appearance of keyboard keys can be set via various properties of the KeyTemplate class, whose instance is exposed via KeyTemplate property of VirtualKeyboard. KeyTemplate along with keyboard's Background and Border properties can be changed simultaneously by setting the Theme property to a member of the Theme enumeration, identifying a predefined theme. You can load a custom theme from an XML file by calling the applyTheme method.

Key images

The Image property of the Key class can be set to the file name of either a bitmap or an SVG image. Image alignment relative to key's bounding rectangle is specified by the ImageAlign property of KeyTemplate.