JClass 4.5.0 API
Documentation

com.klg.jclass.field
Class JCPromptHelper

java.lang.Object
  |
  +--com.klg.jclass.field.JCPromptHelper

public class JCPromptHelper
extends Object
implements ContainerListener, FocusListener

This class allows the user to display the ToolTipText in a specified prompt label of any container whenever that field component gains focus and to remove the text when the field loses focus. Note this helper is NOT restricted to finding JCFieldComponents that are immediate children of the specified container.


Field Summary
protected  JLabel prompt
           
 
Constructor Summary
JCPromptHelper(Container container)
          Constructs a prompt helper class on the specified container.
JCPromptHelper(Container container, JLabel prompt)
          Constructs a Prompt Helper on the specified container with the specified label as the target for the ToolTipText of the Field components contained within the container
 
Method Summary
protected  void addChild(Component c)
           
 void componentAdded(ContainerEvent e)
          This method is internal.
 void componentRemoved(ContainerEvent e)
          This method is internal.
 void focusGained(FocusEvent e)
          Sets the tool tip text when the field gains focus.
 void focusLost(FocusEvent e)
          Removes the tool tip text when the field loses focus.
 JLabel getPromptLabel()
          Returns the prompt label being used.
protected  void removeChild(Component c)
           
 void setPromptLabel(JLabel prompt)
          Sets the prompt label to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prompt

protected JLabel prompt
Constructor Detail

JCPromptHelper

public JCPromptHelper(Container container,
                      JLabel prompt)
Constructs a Prompt Helper on the specified container with the specified label as the target for the ToolTipText of the Field components contained within the container

JCPromptHelper

public JCPromptHelper(Container container)
Constructs a prompt helper class on the specified container. Note that for this constructor to be useful the setPromptLabel method must be called in its future.
Method Detail

setPromptLabel

public void setPromptLabel(JLabel prompt)
Sets the prompt label to use. If this is not specified either by invoking it in this method or in the constructor then this class will not be useful.

getPromptLabel

public JLabel getPromptLabel()
Returns the prompt label being used.

addChild

protected void addChild(Component c)

componentAdded

public void componentAdded(ContainerEvent e)
This method is internal. You should not have to call this method.
Specified by:
componentAdded in interface ContainerListener

removeChild

protected void removeChild(Component c)

componentRemoved

public void componentRemoved(ContainerEvent e)
This method is internal. You should not have to call this method.
Specified by:
componentRemoved in interface ContainerListener

focusGained

public void focusGained(FocusEvent e)
Sets the tool tip text when the field gains focus.
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent e)
Removes the tool tip text when the field loses focus.
Specified by:
focusLost in interface FocusListener

Copyright© 1999-2000 KL Group Inc.
All rights reserved.