FileBrowser with JPanel Scrollable

I'm trying to show a bunch of images in a panel. That panel would have a fix-size and will be scrollable to display all the pictures, a kind of thumbnail gallery. In fact, I don't understand how the JScrollPanel work with a JPanel and others. Could someone help to get a JPanel scrollable like a Windows Explorer? A panel containing components and scrollable.

I have a FlowLayoutPanel which extends JPanel ...

  public FlowLayoutPanel () 
  {
      setLayout(new FlowLayout());
      this.setSize(new Dimension(1000,1000));
  }

...

Now, I can add images to that panel ! But when the JPanel gets filled at is max (Maximum size), I would like to see a beautiful scrollbar on the right to just scroll through my Panel !

Answers


I'm trying to show a bunch of images in a panel

Maybe you can use a JList. It supports automatically wrapping when horizontal wrap is turned on.

I would like to see a beautiful scrollbar on the right to just scroll through my Panel !

Then you need a custom layout manager, not a custom panel. See Wrap Layout.


Need Your Help

xPages - session.getDatabase not returning value

javascript xpages xpages-ssjs

I have a test database on my PC that has a drop-down field listing all our clients. I'm now trying to redirect it to the database containing this information on the server. (I load it into a session

Any difference between static & dynamic language model in OpenEars?

ios speech-recognition voice-recognition openears

I have been trying to create a game using OpenEars. I am using dynamic language model method. But the performance is not up to the mark. Recognition is very low. Is there any advantage in using sta...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.