Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Nifty Project Image Question

+6 votes
Is there any way to write text over an image after using panel.loadImageAndResizeWindow()? I'm trying to write text after doing this and nothing shows up. Or is there another way to load an image into the panel and write text under it?
asked Oct 27, 2016 in CSC 211 (F16) by Lars Harvey (365 points)

1 Answer

+2 votes

1) You MUST download the updated DrawingPanel.java from Moodle.  The old DrawingPanel.java does not support doing more graphics after loading an image.

2) You also need to get a new Graphics object from the panel after each time you call loadImageAndResizeWindow().  

g = panel.getGraphics();  // again

answered Oct 27, 2016 by Forrest Stonedahl (3,308 points)