Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying thumbnails as a grid

I have an application where I have to display images as thumbnails in a grid and when the users click on one of them , the original picture should be displayed in JAVA. I dont have an
idea as to how to display the thumbnails present in the folder in the form of grid. Any help as to how to start and some sample codes and links would be welcome.

like image 238
Flash Avatar asked Dec 22 '22 14:12

Flash


2 Answers

Work on one thing at a time.

  1. Read about LayoutManagers and build a program that will lay out components in a grid.
  2. Figure out how to read images and create a thumbnail. Add that to your program.
  3. Mess with JDialog and creating popups. Also look at Action classes and ActionListeners to tie creating a popup to a button click.
like image 137
jzd Avatar answered Dec 29 '22 00:12

jzd


Are you working in Swing? What part do you have problems with? If it's the layout, you can start with the GridLayout

Depending on how you want to implement the zoom, a Frame will be useful.

And to display the bitmaps, a Label will do.

like image 24
Peter Avatar answered Dec 29 '22 00:12

Peter