5

I'm using Swing and while debugging, I would like to redraw the whole frame to help me understand what's going on. I can perfectly look at my local variables with my debugger but nothing is like visual feedback. How can I force a frame/panel to repaint itself?

I don't care how dirty/unappropriate for real applications the solution is, I just want to execute that with my debugger's expression evaluator while I'm debugging. Since the repaint() method seems to do nothing but to add a event to the event queue, it is not working when my debugging pauses my application. I feel like I will need to make the EventQueue or UI thread update itself but I don't know how.

I would like to have a solution to repaint while I'm in the EventQueue thread but also interested to know what's different if I'm in another thread. I'm debugging using IntelliJ Idea.

Winter
  • 3,894
  • 7
  • 24
  • 56
  • 1
    See https://stackoverflow.com/questions/4761374/force-immediate-layout-and-paint-in-swing , https://stackoverflow.com/questions/4120528/repaint-in-a-loop , etc. perhaps. YMMV. – user2864740 Jul 29 '17 at 00:48
  • 1
    @user2864740 Indeed, `paintImmediatley()` did the job – Winter Jul 29 '17 at 01:05

0 Answers0