• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JPanel not displaying Image

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm fairly new to Java but have quite a lot of experience in other programming languages. Struggling to get my head around it slightly though, I have managed to create a small maze game (Tile based) and am now refining it to make a more advanced version. But now i have begun this the method of drawing the tiles is no longer working? Scripts below -

This is the main class


And this is my map class


I have made the drawMap(); function as basic for testing purposes and have also tried it with -



Which worked a treat.

Thanks in advance - Marcus
 
Marcus Setchell
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh i have resolved the problem it was a stupid mistake which i am actually embarrassed to admit but i will to remind people who search for the same thing to not make this mistake.

I had 2 versions of the image in the tiles directory one BMP and the other PNG. This was because i wasn't sure on which file type to use. the grass.bmp wouldn't display i think possibly because of the method im using to load the images the other was called g.png therefore i was trying to load a file that did not exists!

Sorry for the inconvenience.

Marcus
reply
    Bookmark Topic Watch Topic
  • New Topic