display ArrayList of images on JPanel

Im trying to display all images in directory selected by the user on a JPanel but my images dont get displayed!

public Viewer() {
        super() ;
       
        fc.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY ) ;
        status = fc.showOpenDialog( this ) ;
       
        if ( status == JFileChooser.APPROVE_OPTION ) {
            directory = fc.getSelectedFile() ;
            d.getDirectoryListing( directory ) ;
        }

        imageStats = "Folder: " + directory.getAbsolutePath() + "\n" ;
        imageStats += "No. of Images: " + d.listOfImages.size() + "\n" ;
        imageStats += "Images:" + "\n" ;

        info.setPreferredSize( new Dimension( 100, 200 ) ) ;
        info.setText( imageStats ) ;
        infoPanel.add( new JScrollPane( info ) ) ;
        infoPanel.add( info ) ;

        columns = d.listOfImages.size() ;
        imagePanel.setLayout( new GridLayout( 1, columns, 5, 5 ) ) ;

        for ( int i = 0 ; i < d.listOfImages.size(); i++ ) {
            imageStats += d.listOfImages.get( i ).toString() + "\n" ;
            imagePanel.add( new JLabel( new ImageIcon( d.listOfImages.get( i ).toString() ) ) ) ;
        }

        this.getContentPane().add( imagePanel, "Center" ) ;
        this.getContentPane().add( infoPanel, "South" ) ;
        this.setVisible( true ) ;
        this.pack() ;
    }
LVL 16
ellandrdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
check the filenames u are adding:
           System.out.println(d.listOfImages.get( i ).toString() );
           imagePanel.add( new JLabel( new ImageIcon( d.listOfImages.get( i ).toString() ) ) ) ;
 
0
ellandrdAuthor Commented:
filenames are fine.  it was one of the frist things i checked...
0
objectsCommented:
do the other panels appear?

after adding them try revalidating the frames content

      ((JComponent)(this.getContentPane()).revalidate() ;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ellandrdAuthor Commented:
Its working now...

thank you
ellandrd
0
objectsCommented:
no worries :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.