Help with netbeans

E

ebe

Hi,

I am trying to deploy a netbeans application on a server. The problem
is that it uses frames, and I have re-written it so that it updates an
imageComponent on the webapp page.

The code look like this:

try {
File outputfile = new File("/saved.jpg");
ImageIO.write(im1, "jpg", outputfile);
write1("Image saved\n");
} catch (IOException e){
write1("Image not saved\n");
}
//****************
//* Need to transfer im1 to image1 to paint it on the screen
//****************
image1.setUrl("/saved.jpg");

The variable im1 is a bufferedImage and the variable image1 is the
imageComponent that exists on the webapp, webpage.

But, the problem is that puts the filename as the URL, but does not
show the image. I checked the image is valid. Also, I tried using
system.SetProperty("java.awt.headless=true","true") before doing this
re-write.

Any suggestions,

Diana
 
G

gwoodhouse

Hi,

I am trying to deploy a netbeans application on a server. The problem
is that it uses frames, and I have re-written it so that it updates an
imageComponent on the webapp page.

The code look like this:

try {
File outputfile = new File("/saved.jpg");
ImageIO.write(im1, "jpg", outputfile);
write1("Image saved\n");
} catch (IOException e){
write1("Image not saved\n");
}
//****************
//* Need to transfer im1 to image1 to paint it on the screen
//****************
image1.setUrl("/saved.jpg");

The variable im1 is a bufferedImage and the variable image1 is the
imageComponent that exists on the webapp, webpage.

But, the problem is that puts the filename as the URL, but does not
show the image. I checked the image is valid. Also, I tried using
system.SetProperty("java.awt.headless=true","true") before doing this
re-write.

Any suggestions,

Diana

Could this be a problem with the leading "/" in your path?
 
L

Lew

Could this be a problem with the leading "/" in your path?

Or with using File to open it instead of, say, URL, or
ServletContext.getResource() or Class.getResource() to return a URL?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top