java - Drawing something in front of any other object/drawing -


i making small game, , need more it. want make if player1 , player2 finished, white screen pop on whole screen in front of object or drawing made. i'm using code @ moment:

if( isfinishedp1 == true && isfinishedp2 == true ){         graphics2d b = buffer.creategraphics();         system.out.println("both finished, drawing whitescreen!");         b.setcolor( color.white );         b.fillrect(0, 0, 800, 600);         b.dispose(); } 

my console says both finished, won't draw white screen. don't see anything, , have suspicions it's drawing behind background , objects. place white screen, rectangle, @ (0,0) (x , y coordinates respectively), , window 800x600 (width x height).

how draw rectangles in front of object, or there better way this? purpose of white screen act "endgame screen" can select if want again, or go next level. there no errors when execute code.

in code showing draw buffer whithout specifying comes , goes to.

in general should overwrite paint method , if draw white rectangle after else on top else.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -