Results 1 to 3 of 3
Thread: Accessing ImageObserver?
- 12-10-2009, 03:51 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 7
- Rep Power
- 0
Accessing ImageObserver?
I just learned Java and OO concepts, but still don't fully know how to work with it. I am supposed to design part of a chess program for my Computer Science class in high school, and this is what I have now:
chessboard extends Applet, has the public void paint() function. It instantiates Pawn, a Chesspiece subclass, and draws itself out with g.drawImage(). Now the problem is: what do I put in for the ImageObserver parameter?
I know if I was to call g.drawImage in chessboard, all I need is "this". Is there anyway without using parameters (I will have to change quite a lot of lines, and considering I will always use the same ImageObserver, there is no reason to create a separate ImageObserver parameter) to access the ImageObserver used at chessboard?
I'm sorry if this question sounds confusing, I'm trying my very best to explain it... thanks in advanced for any input!
- 12-10-2009, 07:34 PM #2
You can use null in place of the ImageObserver.
Java Code:g.drawImage(image, x, y, null);
- 12-12-2009, 06:29 AM #3
Member
- Join Date
- Dec 2009
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
Help: how to set imageObserver
By xing217sg in forum AWT / SwingReplies: 3Last Post: 10-21-2009, 07:07 PM -
Accessing USB
By FieryProphet in forum NetworkingReplies: 3Last Post: 12-13-2008, 06:29 AM -
Accessing file
By Doctor Cactus in forum New To JavaReplies: 1Last Post: 10-24-2008, 08:31 PM -
accessing cddrive
By milinkp in forum AWT / SwingReplies: 2Last Post: 02-06-2008, 09:38 AM
Bookmarks