Forums Register Login

display t/ read the total num of pic file that been save in a folder

+Pie Number of slices to send: Send
hi..

can someone help me,

i need to displayat the "JTextField" the total number of image file(.jpg) that been save in a folder.

how can i do that..i dont have any idea what function shall i use and where to start..

hope someone able to help me..

thanks
+Pie Number of slices to send: Send
Is the problem in determining the number of image files, or the displaying of that numbe rin the GUI?

If the former, have a look st this example code. It lists all the file sin a directory. You would need to adapt the accept method so that it only returns true for image files. Which ones those are depends on your circumstances, but for starters, probably those whose lowercase extension is "gif", "jpg", or "png".

As for the GUI, you should use a JLabel instead of a JTextField, since the number of files is not editable, right?
+Pie Number of slices to send: Send
Thanks Rob Prime....
you really help me a lot...
Thanks once again...
+Pie Number of slices to send: Send
You're welcome, even if I'm not Rob :-)

Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


Reply locked
This thread has been viewed 776 times.
Similar Threads
create a folder and choose that folder to save a newly created file
problem in unzipping
excel file opening,editing and saving
create a folder and choose that folder to save a newly created file
file saving
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:54:26.