@Deprecated
public final class BalloonManager
extends java.lang.Object
Balloon
s. Balloons are associated with some
target component. You can obtain the BalloonManager instance for
a given component using the forTarget(JComponent)
method.
Balloon
s are added to the layered pane of the JFrame
or
JDialog
containing the target component when you call
show(Balloon,int)
. The BalloonManager will track the motion of the
target component and ensure that the Balloon continues to point
at it.
The BalloonManager will clean up (remove the balloon from the layered pane,
and deregister listeners) when the target component is removed from its
container or hidden. However, if you are hiding a dialog or frame containing
a target component, you should take care to clean up the balloon manager
for any visible balloons via hide(Balloon)
.
Thread Safety: This class is not thread safe. It should be used only from the AWT event dispatch thread.
Modifier and Type | Field and Description |
---|---|
static int |
TTL_ACTION_FAILURE
Deprecated.
Recommended time to live for a balloon showing notification of a failed
action.
|
static int |
TTL_ACTION_SUCCESS
Deprecated.
Recommended time to live for a balloon showing notification of a successful
action.
|
static int |
TTL_OPTIONAL_USER_TASK
Deprecated.
Recommended time to live for a balloon showing notification of an optional
user task.
|
Modifier and Type | Method and Description |
---|---|
Balloon |
balloon()
Deprecated.
Returns the balloon this manager is tracking.
|
static BalloonManager |
forTarget(javax.swing.JComponent target)
Deprecated.
Gets a BalloonManager for the specified target component.
|
void |
hide(Balloon balloon)
Deprecated.
Hides a balloon and cleans up all references.
|
void |
show(Balloon balloon)
Deprecated.
Shows a
Balloon pointing to a specified target component. |
void |
show(Balloon balloon,
int timeToLive)
Deprecated.
Shows a balloon pointing to a specified target component.
|
public static final int TTL_ACTION_SUCCESS
public static final int TTL_ACTION_FAILURE
public static final int TTL_OPTIONAL_USER_TASK
public static BalloonManager forTarget(javax.swing.JComponent target)
target
- a target component.java.lang.NullPointerException
- if target is null.public Balloon balloon()
public void show(Balloon balloon, int timeToLive)
JFrame
or
JDialog
in its component hierarchy.
You can specify how long the balloon should remain on screen. After the specified period elapses, the balloon will be closed automatically.
balloon
- the balloon component to show.timeToLive
- time in milliseconds the balloon should remain visible.
After this period of time elapses, the balloon will be removed. A number
of standard values for this parameter are defined as static constants.java.lang.IllegalArgumentException
- if timeToLive is less than zero.java.lang.NullPointerException
- if balloon is null.java.lang.IllegalStateException
- if the targetComponent is not visible,
or the targetComponent is not inside a JDialog or JFrame.public void show(Balloon balloon)
Balloon
pointing to a specified target component. The target
component must be visible, and it must have a JFrame
or
JDialog
in its component hierarchy.
It is strongly recommended that clients use the show(Balloon,int)
method with one of the TTL_ constants declared on this class. This ensures
that Balloon
s are dismissed after a suitable period of time
automatically.
balloon
- the balloon component to show.{@link
- NullPointerException} if parameters are null
.{@link
- NullPointerException} if The target
is not a
JFrame
or JDialog
, is not visible, or already contains a Balloon.public void hide(Balloon balloon)
balloon
- a balloon to hide.