A web browser displays the content written in HTML markup, not in Java source code. Even if the web browser; or the control being used, is written in Java the web browser would still be looking for a code written in HTML markup. Something like the following DOM tree form,
<html>
<head>
<title>My Photo Viewing Page</title>
</head>
<body>
<img src="some-location-to-image.png"
alt="Photo didn't load correctly" />
</img></body>
</html>
This, once loaded as a file (with .html format) would display the image in the browser. The web browser control would take care of rendering, you don't have to worry about it at all.