What is this?

BeanTableModel is TableModel implementation for the swing component: JTable.

  • The main purpose of this model is to easily put an Array/List/Collection of JavaBean (Pojo) into a JTable and manage modification into bidirectional mode (from model and from UI). To do this we use java annotation.
  • The second challenge is to provide a 'blinkink' (or Flash) feature when data are updated from the model (i mean out of user interaction, from background thread for example, but works when modfification comes from UI).
  • finally we provide a little framework for Cell Renderer (always based on annotation and inspired by SwingX highlighter). You can chain plugin renderer to make only the stuff you want and reuse existing others.

In both case, we aim to provide very good performance (in fact with minimum CPU impact as possible).

Requirement

To do this, we use a recent JDK (tested with 1.6) and annotations. See instructions.

Usage

See Library installation.

look at Sample TODO.

Features List

  • Generic TableModel based on JavaBean property and annotation (naming convention) with extended features:
    • Add/Remove/update row.
    • update only one cell from background thread.
    • reset the model (empty or from another fresh collection).
    • possibility to define property auto discover with Class level annotation.
  • Support Java 1.6 TableRowSorter.
  • Thread safe optional (configuration with annotation) .
  • Flash Cell (blinking). You can customize flash count for an update.
    • You can also customize Flash strategy: Animated background Color, Background/Foreground Color, Font or Border).
    • possibility to apply blinking at Class level on all model properties.
  • Cell renderer plugin (with chaining). We provide annotation:
    • Date Renderer (format can be customize into annotation)/
    • Bg/Fg Color (fg/bg can be customize into annotation).
    • Stripped background color (odd/even bg can be customize into annotation)
    • Up/Down icon Renderer (icon can be customize into annotation parameters).
    • Can Define your custom renderer plugin.
    • Blinking renderer.
  • No external dependencies (except logger: slf4j).
  • Jar size is only 50 Ko.

Roadmap (TODO)

  • DONE- Update lake of Javadoc.
  • DONE - Update demo to use RowFiler and sorter.
  • DONE - Update demo to use MigLayout (remove group layout).
  • DONE - Add new default Flash renderer with animated backgroundcolor.
  • DONE - Update demo to make blinking more dynamic (done on flash duration).
  • DONE - Update demo to use Substance L&F.
  • Add resource management for column name.
  • DONE - Change ABlinking scope to authorize Class level to get default blinking option for all setter.
  • KO - SwingX JXtable tested but some strange stuff is done on JXTable (renderer or model i don't know, but model notification does not works ...). i suspect that it's not compatible with jdk 1.6 and RowFilter ?
  • Done - Update Annotation to support trivial CellRender (AlternateRowColor, Cell Back/Foreground color, Up/Down arrow renderer ...)
  • read property description in another way that annotation (useful when you can not annotate a POJO (provided by other team)).
  • LOW P. - Provide new implementation more faster for TableFlasher (less CPU/memory).

Similar tools

  • I'm not fully aware of BeanBinding feature, but you should probably find what you want about bean mapping between swing component and bean.

Feedback

If you notice any issues, please feel free to post an issue, or join the project.

Thanks

This works is based on different other works:

Third Libraries used (for demo):