aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes DISPLAY an IMAGE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "DISPLAY an IMAGE" Watch "DISPLAY an IMAGE" New topic
Author

DISPLAY an IMAGE

Zaafir Barahim
Ranch Hand

Joined: Dec 12, 2006
Posts: 36
i want to display an image which i have in a specific folder. i want to display that image using JAVA. please HELP me OUT!!!Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42934
    
  68
So you have an applet that loads an image from the web server from where it's hosted? If so, then this example applet may get you going.
Zaafir Barahim
Ranch Hand

Joined: Dec 12, 2006
Posts: 36
i just want to display an image using JAVA. no need to be use a web server. Just simple code to display an image
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42934
    
  68
In that case, the javax.imageio package will do nicely, as is shown here.

I'll move the topic to the AWT/Swing/GUI forum, since there's nothing applet-specific about the question.
Zaafir Barahim
Ranch Hand

Joined: Dec 12, 2006
Posts: 36
Thanks the code works. but i want to display 2 images, 1 big image as background and then another small image on the big image. please help me out for the code, thanks in advance!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42934
    
  68
In that case, first load and draw the background image, and then draw the front image on top of it.
Zaafir Barahim
Ranch Hand

Joined: Dec 12, 2006
Posts: 36
can i get a sample code which enable me to do this. im new on this topic. thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42934
    
  68
The first link I posted shows how to draw an image. Did you get that to work? If so, you can use a similar method call to draw the second image on top of it. You'd probably want to use different x and y coordinates, depending on the size on the images, and their desired locations.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DISPLAY an IMAGE