I'm trying to create an applet that loads 52 cards, shuffles them(using random number generator), then displays the top 10 cards of the deck in two rows of five. I have the HTML file with the 52 images of the cards, but is there a way to load the images without having to load each individual image. And how do you load images from the web?
You need to look into something more advanced than HTML. To create an "Applet" you want Java.
I'm making the applet in java
but the pictures are online so I need to access them through a HTML file
The HTML file displays the images, but in fact you had to download them to your computer for you to even see them. What you want to do is download those images so that your java program can find them in their local directory.
I would suggest you just find your own 52 cards in a zip file though. Try googling for it.
Otherwise you'd have to use the http request object to download the images from the server, which is way too complicated and introduces a ton of annoying security issues.
SO you're trying to make an applet to place cards onto the html page, or within the Applet? If everything is in the applet then you would store the pictures there,
I just need a way to load the cards using a loop. All the cards have different names so that is a problem
and I'm displaying it on the HTML page
This is a python forum !
^ no it isn't...
Join our real-time social learning platform and learn together with your friends!