Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Useless JFrame Clearing  RSS feed

Charles Rector
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I create a JFrame and then drag a component over it, it constantly clears the "damaged" area of the JFrame with its background color before repainting. To make the behavior more noticeable as I was trying to alleviate it, I set the background color to red. Repainted areas became VERY evident, especially when dragging windows from other apps over the frame, and even more especially when the OS is set to repaint window contents while dragging, instead of the outline dragging method. No matter what I seem to try overriding, the clearing still occurs.

Even without the red, this behavior really annoys me. It looks ugly and unprofessional and I really don't see why JFrame seems to think it's necessary to clear the background at all. It always gets completely painted over in the end anyway.

Is there any way to stop this clearing from happening? I've tried overriding update() and paint() and many other things without much luck.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!