2
Graphics g = bs.getDrawGraphics();
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth(), getHeight());
g.dispose();
bs.show();

Does calling bs.show() actually display the buffered frames? If so, how? It simply says that it makes the next available buffer visible, but how about current buffer? When does it get displayed?

Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183
sodaluv
  • 449
  • 2
  • 9
  • 22
  • 1
    See here http://stackoverflow.com/questions/13590002/understand-bufferstrategy : When you finally call bs.show(), bs will cause the buffer that you just drew to become the current buffer for the JFrame – c0der Jul 09 '16 at 09:50

1 Answers1

2

According the documentation:

Makes the next available buffer visible by either copying the memory (blitting) or changing the display pointer (flipping).

Simply said it means the BufferStrategy becomes the current buffer for the JFrame.

Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183