We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,466 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to import a picture Applet

I am in a java programming class but my teacher doesn't teach anything so could someone please explain to me how to import a picture into the applet and give me an example of a simple script that just imports a picture. I have learned how to use the mouse and the graphics and all of that.


Thanks.

BTW I'm going to try to make a slider puzzle.

2
Contributors
3
Replies
2 Hours
Discussion Span
2 Years Ago
Last Updated
4
Views
sirlink99
Practically a Master Poster
694 posts since Oct 2010
Reputation Points: 58
Solved Threads: 19
Skill Endorsements: 2

Not sure this is what you are looking for, but here are a couple links that might help.
http://www.exampledepot.com/egs/java.applet/LoadImageApplet.html
http://www.realapplets.com/tutorial/ImageExample.html

kramerd
Posting Pro in Training
405 posts since Sep 2010
Reputation Points: 49
Solved Threads: 75
Skill Endorsements: 0

I am in a java programming class but my teacher doesn't teach anything so could someone please explain to me how to import a picture into the applet and give me an example of a simple script that just imports a picture. I have learned how to use the mouse and the graphics and all of that.


Thanks.

BTW I'm going to try to make a slider puzzle.

I would like to add the picture from a file not a website and is there a way to re-size the image?

sirlink99
Practically a Master Poster
694 posts since Oct 2010
Reputation Points: 58
Solved Threads: 19
Skill Endorsements: 2

The 2nd link I sent shows how to load an image from a file. You can call getScaledInstance to resize the image. See the documentation for more details.

kramerd
Posting Pro in Training
405 posts since Sep 2010
Reputation Points: 49
Solved Threads: 75
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.1019 seconds using 2.7MB