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 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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.