borland Packages  Class Hierarchy  dbswing Package 

JdbStatusLabel component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----javax.swing.JComponent
                           +----javax.swing.JLabel
                                   +----com.borland.dbswing.JdbStatusLabel

About the JdbStatusLabel component

Variables  Constructors  Properties  Methods  Event Listeners

Implements AccessListener, DataChangeListener, NavigationListener, StatusListener, FocusListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, SwingConstants

Note: This is a feature of JBuilder Professional and Enterprise.

JdbStatusLabel is a visible, non-editable component that displays DataSet status and validation messages, such as "Record 1 of 20" or "Value entered is greater than the maximum allowed". A single JdbStatusLabel can be used to display messages from several DataSets (though only one at any given time).

There are three ways to set up a JdbStatusLabel for use in your application:

If autoDetect mode is used and there is only one DataSet detected, JdbStatusLabel automatically attaches itself to that DataSet. Otherwise, to avoid any ambiguity, JdbStatusLabel waits until a component associated with a DataSet is focused, and then attaches itself to that DataSet. In this case, the initial message displayed by JdbStatusLabel can be configured in one of two ways:

JdbStatusLabel updates its current DataSet message source when focusGained events occur. Therefore, when focus moves from a data-aware component to a non-data-aware component, the message area is not cleared.

The displayMessages property controls whether messages caused by DataSet actions are displayed by JdbStatusLabel. Setting this property to false allows background changes to be made to DataSets without the corresponding status messages being displayed.

Setting the initial size of JdbStatusLabel

Depending upon the layout you use, you might need to set JdbStatusLabel's preferredSize property to have it appear correctly when it is initially displayed (especially if it has blank text).

Controlling the duration user-defined text remains

You can use the setText() method to display a message at any time in JdbStatusLabel's text area. The message is overwritten, however, the next time a DataSet status event occurs. To prevent the message from being overwritten, set the displayMessages property to false until you want the message to be overwritten.

Refreshing the most recently displayed status message

Call repaint() to refresh the most recently displayed status message.


JdbStatusLabel variables

Variables implemented in java.awt.Component

Variables implemented in javax.swing.JComponent

Variables implemented in javax.swing.JLabel

JdbStatusLabel constructors

JdbStatusLabel properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.lang.Object

Properties implemented in javax.swing.JComponent

Properties implemented in javax.swing.JLabel

JdbStatusLabel methods

Methods implemented in this class

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.lang.Object

Methods implemented in javax.swing.JComponent

Methods implemented in javax.swing.JLabel

JdbStatusLabel event listeners


JdbStatusLabel constructors

JdbStatusLabel()

  public JdbStatusLabel()
Constructs a JdbStatusLabel component by calling the null constructor of its superclass.

JdbStatusLabel properties

autoDetect

 public boolean isAutoDetect()
 public void setAutoDetect(boolean autoDetect)
Returns and sets whether JdbStatusLabel automatically attaches itself to DataSets within its enclosing highest-level container (usually a JFrame). The default value is true, but the value changes to false if you set the dataSet property. Auto-detection occurs when the JdbStatusLabel is realized. Setting autoDetect to false after the component is realized sets the currently defined array of data-aware components (to which JdbStatusLabel listens for events) to those specified by the dataSetAwareComponents property. Setting the dataSetAwareComponents property to a non-null value changes the value of autoDetect to false. Setting autoDetect to true, clears the dataSetAwareComponents and the dataSet property values.

dataSet

 public DataSet getDataSet()
 public void setDataSet(DataSet dataSet)
Returns and sets the DataSet that is the source of the status messages displayed by this component. Setting this property to a non-null value disables the autoDetect property, and specifying a null value automatically enables the autoDetect property. When both the dataSet and dataSetAwareComponents properties are set, the one set most recently is the one that takes precedence and the setting of the other one is cleared.

dataSetAwareComponents

 public Component[] getDataSetAwareComponents()
 public void setDataSetAwareComponents(Component[] dataAwareComponents)
Returns and sets the list of data-aware components to which JdbStatusLabel listens for DataSet status messages. Setting this property to a non-null value disables the autoDetect property, and specifying a null value automatically enables the autoDetect property. When both the dataSet and dataSetAwareComponents properties are set, the one set most recently is the one that takes precedence and the setting of the other one is cleared.

See also: autoDetect, DataSet

displayMessages

 public boolean isDisplayMessages()
 public void setDisplayMessages(boolean displayMessages)
Returns and sets whether messages are displayed. This property can be set to false to hide messages from the user. This is most useful when you want to temporarily hide messages from the user, or want to display a message of your own without having it overwritten by DataSet status messages. Set displayMessages back to true when you no longer need to hide the status messages.

focusedDataSet

 public DataSet getFocusedDataSet()
 public void setFocusedDataSet(DataSet dataSet)
Returns and sets the DataSet from which the current status text is obtained. This property can also be used to specify which DataSet's status should be displayed initially. To do so, set this property to that DataSet, and leave the text property blank ("").

Messages from the specified DataSet continue to be displayed until another data-aware component receives focus, at which time messages from its DataSet begin displaying.

This is not a bound property and does not fire a property change event.


JdbStatusLabel methods

addNotify()

  public void addNotify()

Overrides: com.sun.javax.swing.JComponent.addNotify()


JdbStatusLabel event listeners

This component is a source for the following event sets.

ancestor

 public void addAncestorListener(javax.swing.event.AncestorListener )
 public void removeAncestorListener(javax.swing.event.AncestorListener )

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener )
 public synchronized void removeContainerListener(java.awt.event.ContainerListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

inputMethod

 public synchronized void addInputMethodListener(java.awt.event.InputMethodListener )
 public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )

propertyChange

 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )

statusLabel

 public final void addStatusLabelListener(StatusLabelListener listener)
 public final void removeStatusLabelListener(StatusLabelListener listener)

vetoableChange

 public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
 public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )