I decided to to a bit of training with 2D and wanted to draw an image on screen. I followed a tutorial and wrote the code, however the image does not appear.
It does not throw up an error or anything, it just displays the window and the image does not appear.
Adam Miszczak wrote:Oh my. I feel so stupid :P Yep, it BMP is not supported, thanks for the swift response.
Instead of paint method overide paintComponent method. Also I'm not pretty sure but i think BMP is supported today, You can use BufferedImage instead of awt.Image if You like and use ImageIO.read for loading image into memory. In my application developed entirely in swing I have no problems with reading BMP images to be honest.
Ah and always remeber to dispose Graphics or Graphics2D when not used.