• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to reduce flicker when moving JWindow?  RSS feed

 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a MouseMotionListener hooked up to a JWindow so that I can move the window with a mouse drag. The problem is that the JWindow flickers like crazy and looks really bad when it is being dragged across the screen. Does anyone know of a way to prevent this?
Thanks,
Barry
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose your JWindow is not inside a JDesktopPane? This one would have the option setDragMode(JDesktoPane.OUTLINE_DRAG_MODE).
Otherwise: Try to do the painting (=dragging) inside SwingUtilities.invokeLater(Runnable).
Chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!