How to display JPG files that are stored on the user’s computer?

P

PHPBABY3

I have an application that is written in PHP. I would like to do as
follows within that application:

1. The user identifies any directory on his computer.
2. I go through that directory and find all JPG files in it.
3. I display those JPG files.

Thanks,

P -
 
S

ssarimura

I have an application that is written in PHP. I would like to do as
follows within that application:

1. The user identifies any directory on his computer.
2. I go through that directory and find all JPG files in it.
3. I display those JPG files.

Thanks,

P -

I am not very good at Java yet, but I thnik you can look at "File"
class to get some information about the stuff that you want..
Hope this helps..

Take care!

Salim.
 
M

Martin Gregorie

I am not very good at Java yet, but I thnik you can look at "File"
class to get some information about the stuff that you want..
Hope this helps..
Implement a concrete subclass of FileFilter that recognises jpeg files and
use that with the File.listFiles() method to get a list of the jpeg files
in the directory.
 
C

Chase Preuninger

oh forgot that you need to see all JPG's in a dir also if you need to
search the sub directories then use the list() method with method
recursion.

File dir = new File(...);
for(String s : dir.list())
{
if(s.toLowerCase().endsWith(".jpg"))
{
//string s is the full path of a jpg file
}
}
 
C

Chase Preuninger

Man am I mixed up, also forgot to say that to display the image just
override the paintComponent(Graphics g) method in the JComponent class
and just use a drawImage function in the Graphics class to draw the
img.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top