Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

Help with netbeans

Thread view: 
ebe - 30 Jan 2008 18:21 GMT
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
gwoodhouse@gmail.com - 31 Jan 2008 08:37 GMT
> Hi,
>
[quoted text clipped - 27 lines]
>
> Diana

Could this be a problem with the leading "/" in your path?
Lew - 31 Jan 2008 15:37 GMT
>> Hi,
>>
[quoted text clipped - 29 lines]
>
> 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?

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.