Meaningless Drivel is fun!
The moose likes Swing / AWT / SWT and the fly likes add/remove components by timer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "add/remove components by timer" Watch "add/remove components by timer" New topic

add/remove components by timer

Shay Gaghe
Ranch Hand

Joined: Sep 03, 2001
Posts: 102
Hello Coders!
I need to implements a functionality that resembles to Components.setToolTipText().
My GUI consisting of an Image, textfield and a button. When the button pressed I want the textfield�s input to be shown on a � balloon� that attached to the image and disappeared after a few seconds.
I�ll implement it by dynamically adding the �balloon� in response to button�s action and remove it after a few second.
What object I need to use for providing a timer, which can tells the component(balloon) to be removed after a few seconds?

Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Shay,
If you are using JDK 1.2 or newer you should use the
Shay Gaghe
Ranch Hand

Joined: Sep 03, 2001
Posts: 102
Thanks for the reply
By setting setToolTipText() to a component , whenever you mouse over that component it displays the tip bar on topmost layer.
In my program architecture I need to extend Jpanel with an image and with a draw of a balloon. Whenever I use this Jpanel I need the balloon to be the topmost layer within the framework.
How can I control the z-index over the GUI?
How can I provide a topmost layer�s behavior?
Thanks in advance

I agree. Here's the link:
subject: add/remove components by timer
It's not a secret anymore!