Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

graphics

 
ShawnNev
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.
 
Daniel Searson
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic