• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Create a lightweight collection view  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a collection view, similar to the iOS Collection View. This collection view is associated with JTable so the user can toggle between views. I've implemented ResultSetGridPanel which is visually what I want (see image; proprietary chemistry is blurred) It is using a ModifiedFlowLayout and adding ReactionResultCellPanel which subclass JPanel.

The problem is I can have multiple tabs, each with their own grids, that can have up to 500 cells. So memory becomes a problem with thousands of JPanels.

I'd like to paint more like a JTable. Is is possible to either 1) reuse a single JPanel just for painting or 2) try to make ReactionResultCellPanel a subclass of JLabel and paint? I assume approach #1 means ResultSetGridPanel has a custom paint method, but I'd lose the benefits of my layout manager. Approach #2 seems like an easier approach if I can paint the cell properly.

I've attached the grid and cell classes. Thanks.



[Thumbnail for CollectionView.png]
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!