Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2004

Tip: Looking for answers? Try searching our database.

Suggestions for JClass like functionality

Thread view: 
Adam Lipscombe - 18 Mar 2004 17:15 GMT
Folks,

I havent done any Swing development for a couple of years  - last time I
spent ages wrestling with JTable and eventually resorted to the Sitraka
JClass library to simplify things. I found the native JTable very complex to
use.

I now need to implment a Swing UI that is going to make extensive use of
tables, and I anticipate the need for a easy to use sub-class" component
that wraps or replaces JTable.

Can anyone reccomend anything like the JClass library components that is
either free or cheap?

TIA - Adam Lipscombe
Jonathan Fuerth - 18 Mar 2004 18:24 GMT
> I now need to implment a Swing UI that is going to make extensive use of
> tables, and I anticipate the need for a easy to use sub-class" component
> that wraps or replaces JTable.
>
> Can anyone reccomend anything like the JClass library components that is
> either free or cheap?

JTable isn't all that difficult to subclass:

public class MyJTable extends JTable {
}

Seriously, though, if you create your own TableModel (there are only 9
methods in the interface, all of which are trivial to implement if your
data is stored internally as anything resembling a 2-d table) then
you'll be laughing.  As far as getting the data goes.

If you're more concerned with the look of the table than with the data
that it shows, you can override JTable.getCellRenderer(row,col) and
return a custom renderer.  TableCellRenderer only has 1 method, and it's
easy to implement!

Same goes for cell editors, column sizing, etc.  If you take it one step
at a time, JTable is not the beast it appears to be when you're hit by
the big picture all at once.  Same story for JTree, which seems to
confuse a lot of people.

The most important point I made: Take it slowly.  Start with only a
custom TreeModel, make sure everything works for equal-sized,
non-editable, default rendering cells.  Then add those features one at a
time and you'll be done before you know what happened!

-Jonathan


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.