Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Photo.jpg wont show. The photo is in the directory and is named the same. Is there a problem with the code? I have left
The "Photo.jpg" wont show. The photo is in the directory and is named the same. Is there a problem with the code? I have left out most of the other code that is not about displaying the picture. Also "Problem reading the file" wont show up either, unless the photo isnt in the directory, then it shows.
// display photo or error message if not found BufferedImage photonull; try File file - new File("Photo.jpg"); photo- ImageIO.read(file): catch (I0Exception e)( g.drawString("Problem reading the file", 20, 100); g.drawImage (photo, photoX, photoY, photoWidth, photoHeight, null); g.setFont (new Font( "serif", Font.BOLD, g.setColor (new Color (0,0,255)); g.drawString("Help", 50,100) 25))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started