• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Need to repaint a dialog after modifying its components

I am attempting to repaint a dialog after removing the components from its content pane and adding new ones.  I've tried calling invalidate and repaint, but I get various issues ranging from the screen going blank and me having to move the window for it to repaint to the old components rendering until I move the window and it repaints.

How can I reliably get the window to completely re-layout and re-paint?

I am using Swing / Java 1.6.
  • 2
1 Solution
stev0931Author Commented:
It would appear that calling validate() then repaint() on the root (using SwingUtilties.getRoot) works.  Is there a better / more reliable way to do this?
try invoking just validate method!
validate is what you need to call if any comp is added/removed!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now