Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedThe "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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions