Grid Thumbnail Display

I have an application in which I have to display images as thumbnails in the grid, and when users click on one of them, the original image should be displayed in JAVA. I have no idea how to display the thumbnails present in the folder as a grid. Any help on how to get started, and some sample codes and links would be appreciated.

+4
source share
6 answers

Work one thing at a time.

  • Read about LayoutManagers and create a program that will expose components in a grid.
  • Learn how to read images and create thumbnails. Add this to your program.
  • Clutter with JDialog and popup creation. Also look at the Action and ActionListeners classes to link the creation of a popup with a click of a button.
+6
source

Do you work at Swing? What part of your problem? If this is a layout, you can start with GridLayout

Depending on how you want to implement scaling, Frame is useful.

And for displaying bitmaps there will be a Label .

+2
source

If you need JComponent, you can try JTable . If you need a layout, check out GridLayout .

+1
source

You can use the Nebula Gallery Widget if you use SWT

+1
source

I recently had the same requirement - and considered using Flowlayout. Unfortunately, as described here, http://tips4java.wordpress.com/2008/11/06/wrap-layout/ - it does not behave as we would like.

Fortunately, you can grab the source for "WrapLayout" from the same page.

When it comes to uploading images to your dashboard, I recommend using SwingWorker for performance, as described here, http://docs.oracle.com/javase/tutorial/uiswing/components/icon.html#efficiency

+1
source

Look at JFlow , this is not what you asked for, but pretty close, and everything is done for you!

0
source

All Articles