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?