i'm using the code bellow (written a couple of years ago) to display a message to a jLabel, for a few seconds
yet, the message does display but with "hicups", not permanently: for example - shows for 4 seconds, then disappears for a fraction of second, then resumes displaying...
i tried several combinations for sleep value and for var i, but the present combination looks like the best so far
is there something wrong with the code?
Any method call that affects the visualization in any way, should(must) be executed from the EDT.
In your case it's not.
The thing is, that you've just created a new worker/background thread on the EDT.
The same result would be achieved, if you'd comment the following lines: 3,4,21 & 22.
The "visual" call in your example is setText(...).
Put it on the EDT like:
Joined: Feb 08, 2004
this isnt the first time it happens: i rely on email notification and when i notice, several hours elapsed since first answer
anyway thank you both for your answers
using the (new) code bellow i dont perceive any irregularity in display
please fell free to comment what i wrote:
thank you for the idea!
i came up to the following code, but for somw reason, when i hover out of rhe button that triggers the method, the message vanishes... i kmow i have some code for hovering, but with the other method that didnt happen