• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

graphics

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do you load graphics from an alternate class.
i.e.
the applet I call from the HTML page is ChessGame.class
if I need ChessGame.java to grab an image from somewhere like
Piece.java the piece is null.
how do I load the image in Piece.java so when it's sent to chessGame.java it's not nulled, currently it loads the image in piece.java as follows.
wPawnI = getImage(getDocumentBase(), "graphics/pawn_w.gif");
but this gives me an error. why.
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To use the getImage() method you have to be inside an applet. So if "Piece.java" isnt inheriting from Applet then it can't find the method.
------------------
- Daniel
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic