Skip to main content
deleted 18 characters in body
Source Link
Ricket
  • 14.9k
  • 6
  • 68
  • 82

In your constructor, try this.setSize(500,500);. You could alternatively try, and you might also need framethis.packsetVisible(true); or something like that. If that still doesn't work, instead of giving the frame a null layout, try giving it a border layout and add this in the CENTER.

I wonder whether ImageIcon is not returning a proper image; try following the trail on Reading/Loading an Image.

Looks like you're using BufferStrategy correctly. You could try commenting out g.dispose();, but I think that's correct.

In your constructor, try this.setSize(500,500);. You could alternatively try frame.pack(); or something like that. If that still doesn't work, instead of giving the frame a null layout, try giving it a border layout and add this in the CENTER.

I wonder whether ImageIcon is not returning a proper image; try following the trail on Reading/Loading an Image.

Looks like you're using BufferStrategy correctly. You could try commenting out g.dispose();, but I think that's correct.

In your constructor, try this.setSize(500,500);, and you might also need this.setVisible(true);. If that still doesn't work, instead of giving the frame a null layout, try giving it a border layout and add this in the CENTER.

I wonder whether ImageIcon is not returning a proper image; try following the trail on Reading/Loading an Image.

Looks like you're using BufferStrategy correctly. You could try commenting out g.dispose();, but I think that's correct.

Source Link
Ricket
  • 14.9k
  • 6
  • 68
  • 82

In your constructor, try this.setSize(500,500);. You could alternatively try frame.pack(); or something like that. If that still doesn't work, instead of giving the frame a null layout, try giving it a border layout and add this in the CENTER.

I wonder whether ImageIcon is not returning a proper image; try following the trail on Reading/Loading an Image.

Looks like you're using BufferStrategy correctly. You could try commenting out g.dispose();, but I think that's correct.