Monday, May 19, 2008

Contributing to The Java Tutorials Community Project

I have been working on contributing to the Java Tutorials Community Project. I've put together some code samples as potential tutorial subjects.
  1. JTable - ColumnsDemo
  2. JTable - ColorEntireRowDemo

  3. JTable - MultiLineRows

  4. JTable - FrozenColumns

  5. JTree - DefaultTreeModelDemo

  6. JTree - CustomEditorDemo

The tutorials project has forums where you can comment on these proposed topics, propose new topics and to request revisions to any of the current Java tutorials. We need your help to create the kind of content that can help reduce the Java learning curve and help create better software.

2 comments:

-S- said...

Hi mr Aberrant. I've seen your code about Frozen Columns in JTable. It's really interesting to know that we can do that in JTable. I tried ur code and it worked. Thank you so much for the code.
In your code there are 2 tables become 1,right? (One table that has the frozen column and the rest in the other table). My question is how to sort the two tables? Because when I tried to sort the table, it's not related each other (just one table that being sort).
I want to post

NB: Sorry if my english is so bad. hope you understand what I mean. Waiting for your reply. :)

Unknown said...

Hi -S-

Java.net is having some issues so I can't look at the code and give you an exact answer. If I remember correctly the 2 JTables both look at the same TableModel. If you want sorting then wrap the TableModel in a TableSorter and pass the sorted table model to both JTables. This was I used before java 1.6 introduced the "table sorting API". I'll look into it when Java.net is back up.