| CARVIEW |
|
richjtable
|
| Summary | Extension of JTable to make the use of tables in your GUI easier |
|---|---|
| Categories | None |
| License | Apache License, Version 2.0 |
| Owner(s) | bambo1543 |
RichJTable Project Page
The RichJTable is a JTable extended with a lot of features wich makes it easier to develop tables for your GUI.

Features
- easy handling of collections with same element type
- sorting column support
- default renderer for Lists and Calendar
- save and load column settings like width, order etc. at runtime in a file or db
- color rules for coloring the table cells
- pageable support to browse between pages
WebStart
Start RichJTable or PageableJTable with Java WebStart.
Components
BeanTableModel
First of all is there the BeanTableModel. It can be instantiated with a Collection of JavaBeans or even POJOs. The BeanTableModel can be used with BeanJTable, StateSaveJTable and RichJTable as well as with a simple JTable. So it's possible to load objects with a O/R-Mapper like Hibernate and put them directly into the BeanTableModel.
Sample: BeanTableModel model = new BeanTableModel(Person.class, list);
TableStatePropertiesSaver (implements TableStateSaver)
With the TableStatePropertiesSaver it's possible to save/load the column settings like width, order and visability at runtime. Column width and order can be modified with the common JTable operations on the JTableHeader (drag and drop). For making columns visible or hide them click with the right button on the JTableHeader and a popup menu appears where you can do this. You can also save/load the settings by the popup menu.
The TableStatePropertiesSaver can be used with every JTable.
Sample:
- TableStateSaver stateSaver = new TableStatePropertiesSaver(table);
- stateSaver.state.importColumnSettings();
Saving and loading is executed by a PropertyManager interface. So it's possible to store the settings where ever you want (e.g. in a database). As default PropertyFileManager is used wich stores them in a property file.
BeanJTable (extends JTable)
The JTables in this project a seperated into three classes. There's the BeanJTable extended by the StateSaveJTable extended by the RichJTable. The BeanJTable can be used with the BeanTableModel as well as with a TableModel and have the following functions.
- default renderer for Lists and Calendar
- sorting column support
- get selected/focused row/s as List/Object (only if BeanTableModel is used)
StateSaveJTable (extends BeanJTable)
The StateSaveJTable has the TableStateSaver integrated. It automatically loads the column settings when the TableModel was set.
- save and load column settings like width, order etc. at runtime in a file or db
- popup menu to do special operations
RichJTable (extends StateSaveJTable)
The RichJTable extends the StateSaveJTable with coloring functions. Every second row has a color. It's possible to add ColorRules. With ColorRules you can set fore-/background color for rows wich objects have specific values.
- color rules for coloring the table cells
- changing colors for each row
PageableTableAdapter
With the PageableTableAdapter a JTable can be wrapped into a JPanel. The PageableTableAdapter has controls to browse between pages. You can instantiate the Adapter with your JTable or without (then a RichJTable will be used). Sample (without JTable): PageableTableAdapter pat = new PageableTableAdapter(Person.class, "PageableTableFrame", list.size()); Sample (with JTable): JTable table = new JTable(); PageableTableAdapter pat = new PageableTableAdapter(table, 0); pat.setMaxRows(list.size()); pat.setDomainClazz(Person.class);
Maven2 integration
<dependency> <groupId>net.java.dev.richjtable</groupId> <artifactId>richjtable</artifactId></br> <version> 1.2.0</version></br> </dependency></br> </p> <h2>Contact</h2> <p> If you have any questions you can write to me at bambo1543@dev.java.net </p> <h2>Participate</h2> <p> At this point, the best way to participate in this project is to use RichJTable. By using it, you will likely find some things that you'd like to improve. Talk to us on the mailing list and let us know what you'd like to see improved. </p> <h2>Project Members</h2> <ul> <li>Andreas Baumgartner andreas.bg@web.de (project leader)</li> <li>Peter Schneider-Manzell</li> </ul> last update 2007-02-19 <p> <!-- Begin Shinystat Free code --> <script type="text/javascript" language="JavaScript" SRC="https://codice.shinystat.com/cgi-bin/getcod.cgi?USER=bamborichjtable"></script> <noscript> <A HREF="https://www.shinystat.com" target="_top"> <IMG SRC="https://www.shinystat.com/cgi-bin/shinystat.cgi?USER=bamborichjtable" ALT="Free hit counter" BORDER="0"></A> </noscript> <!-- Begin Shinystat Free code --> </div> </div> </td> </tr> </table> <div id="footer"> <p><a href="https://today.java.net/pub/q/java_net_rss"><img src="/branding/images/xml.gif" width="36" height="14" alt="XML" style="vertical-align:middle"/></a> <b>java.net RSS</b></p> <table border="0" cellspacing="0" cellpadding="4" width="100%"> <tr> <td><a href="https://www.collab.net/special/clickpbc0502.html" id="poweredby"><span class="alt">Powered by CollabNet</span></a></td> <td><a href="https://java-net.dev.java.net/feedback.html" onclick="return launch(this.href, 1)" title="Note: link may open in new window" class="helplink">Feedback</a> | <a href="https://java.net/faq.csp">FAQ</a> | <a href="https://java.net/presscenter/">Press</a> | <a href="https://www.collab.net/developers/tools/" onclick="return launch(this.href, 1)" title="Note: link may open in new window">Developer tools</a> <div> <a href="https://java.net/terms.csp">Terms of Use</a> | <a href="https://www.sun.com/privacy">Privacy</a> | <a href="https://www.sun.com/suntrademarks/">Trademarks</a> | <a href="https://java-net.dev.java.net/sitemap.html">Site Map</a> </div> <p>© 1995 - 2007 CollabNet. CollabNet is a registered trademark of CollabNet, Inc.</p> </td> <td><a href="https://www.sun.com" onclick="return launch(this.href, 1)"><img src="/branding/images/logo_sun_small.gif" id="logosun" width="61" height="29" alt="Sun" /></a> <a href="https://www.oreilly.com" onclick="return launch(this.href, 1)"><img src="/branding/images/montague_logo_oreilly.gif" id="logooreilly" width="74" height="19" alt="Oreilly" /></a></td> </tr></table> <!-- Begin SiteCatalyst code--> <script language="JavaScript" src="https://www.dev.java.net/branding/images/s_code_remote.js "></script> <!-- End SiteCatalyst code --> </body> </html>
