This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DISPLAY an IMAGE

 
Zaafir Barahim
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, first load and draw the background image, and then draw the front image on top of it.
 
Zaafir Barahim
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i get a sample code which enable me to do this. im new on this topic. thanks
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic