Tab (tag)

From JAXXWiki

getcoeltd The <tab> tag is used to specify tabs within the <JTabbedPane> tag.

Contents

Special Behaviors

While not strictly a class tag, <tab> tags are still reflected by an object at runtime -- specifically an instance of jaxx.runtime.swing.TabInfo. If you assign an id to the tab, you can access the TabInfo using the id. This object has getter and setter methods for all of the attributes (other than id) listed below, and all of the getter methods are bound.

Attributes

AttributeTypeDescription
idjava.lang.StringName used to refer to this object from elsewhere in the file.
backgroundjava.awt.ColorBackground color of tab.
disabledIconjavax.swing.IconIcon for when the tab is disabled.
displayedMnemonicIndexintIndex of mnemonic character within title.
foregroundjava.awt.ColorForeground color of tab title.
iconjavax.swing.IconThe tab's icon.
mnemonicintMnemonic character within title.
titlejava.lang.StringThe tab's title.
toolTipTextjava.lang.StringThe tool tip text that appears when the mouse hovers over the tab.

Child tags

Each tab tag must contain at most one child component, which appears when the tab is selected.

Data binding

As with class tags, all of the <tab> tag's attributes may be assigned data binding expressions, and updates will be properly reflected in the on-screen item's appearance.

Bound methods

A bound method is a method whose value can be tracked by listening to events. For instance, changes to the return value of Component.getWidth() are always accompanied by componentResized events.

Bound methods are significant because they allow the data binding system to detect when they have changed. If you call a bound method within a data binding expression, JAXX will add an event listener in order to detect changes to the method's value. Methods which are not listed below cannot be tracked by JAXX's data binding.

  • getBackground()
  • getForeground()
  • getIcon()
  • getMnemonic()
  • getTitle()
  • getToolTipText()

See also