public final class BalloonTemplate extends BasicTemplate implements ItemTemplate
It is advisable to add subcomponents only via the explicit 'set' methods on this class and not via calling 'add' directly.
Clients can listen for clicks inside the balloon by registering actionListeners.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTION_CLICK_CMD
Action command to indicate the ballon was clicked
|
contentACTION_CLOSE_INFOTIP_CMD, ACTION_REMOVE_TEMPLATE_CMD, ACTION_SIZE_CHANGED_CMD| Constructor and Description |
|---|
BalloonTemplate()
Creates a new balloon.
|
| Modifier and Type | Method and Description |
|---|---|
javax.swing.JComponent |
getContent() |
int |
getPreferredWidth()
Returns preffered width of this template regardless of prior calls to
ItemTemplate.setPreferredWidth(int). |
void |
setContent(javax.swing.JComponent content)
Set the main content for the center of the balloon.
|
void |
setFooter(javax.swing.JComponent footerComponent)
Set component to appear in the footer area.
|
void |
setPreferredWidth(int width)
Sets the preferred width of this template.
|
void |
setTitle(javax.swing.Icon icon,
java.lang.String title)
Set text and icon to be displayed for the InfoTip
|
void |
setTitle(javax.swing.JComponent titleComponent)
Set component to appear in the title area.
|
addActionListener, fireActionPerformed, removeActionListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddActionListener, removeActionListenerpublic static final java.lang.String ACTION_CLICK_CMD
public javax.swing.JComponent getContent()
getContent in interface TemplategetContent in class BasicTemplatepublic void setContent(javax.swing.JComponent content)
content - public void setTitle(javax.swing.Icon icon,
java.lang.String title)
icon - An icon to display in the title (may be null)title - public void setTitle(javax.swing.JComponent titleComponent)
titleComponent - the component to display at the top of the balloon.public void setFooter(javax.swing.JComponent footerComponent)
footerComponent - the component to display at the bottom of the balloon.public int getPreferredWidth()
ItemTemplateItemTemplate.setPreferredWidth(int). Width
should be derived from some important components in the template (for example from title label).getPreferredWidth in interface ItemTemplatepublic void setPreferredWidth(int width)
ItemTemplatesetPreferredWidth in interface ItemTemplate