Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

repaint of java.awt.SysTray blinks. How to avoid that?  RSS feed

 
martin mucha
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm not swing expert so this is rather confusing for me. I want to repaint SystemTray. From one image to another, immediately. Testing code deals with red and black squares. So what I want is red square to be repainted to black square after some time. But I've noticed, that way I'm "waiting" implies how it will be repainted!! Certain "waiting" causes SystemTray repaint like: red square, BLANK SPACE, black square. *What is that*? This sadly includes waiting via Timer, Thread.sleep ... Surprisingly only the most horrible way of waiting will cause nice repaint.

Does anybody know how to avoid this?


 
martin mucha
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've also tried to alter "timer waiting" so that all manipulation with try is wrapped in SwingUtilities.invokeLater() but no change. That icon still blinks.
Any hints / ideas welcomed.

Notes:
tested on two PCs, both rather fast.
tested on oracle JDK8
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!