0

I have many frames. When I move from frame to frame making one invisible and the other visible the screen becomes blank. This means that the next frame opens after a delay. Is there any way to resolve this? Here is my code:

f.setVisible(false);
MyFrame1 f1=new MyFrame1();
f1.setVisible(true); 

f is the object of my first frame,

f1 is the object of my second frame.

Kara
  • 6,115
  • 16
  • 50
  • 57

1 Answers1

0

You can use a buffer for a smooth transition between frames. Also, setting f1 to visible without setting f to invisible, will also work. f will remain visible until f1 is painted over it.

Regarding design, I don't have much information about what you're trying to do, but there may be more efficient ways of painting objects.

Sterls
  • 723
  • 12
  • 22