Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+10 votes

ex.) using .isKeyDown("Left") on a BufferedImage panel

asked in CSC305 Fall 2019 by (1 point)

1 Answer

+4 votes

BufferedImage is not a panel. It's merely an image.

The panel object is what would need to interact with keyboard/mouse etc.

(Note: ideally, it would be better to use raw Swing or JavaFX, instead of using the DrawingPanel from CSC 211 -- it was meant for educational purposes, not for building real software / games.)

answered by (508 points)

Thank you!