File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

add/remove components by timer

 
Shay Gaghe
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shay,
If you are using JDK 1.2 or newer you should use the
javax.swing.Timer
object.
Regards,
Manfred.
 
Shay Gaghe
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic