🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12534

Thoughts/questions/suggestions on JTable/JdbTable and the JBCL datasets

#12534
From: Tommy Cox
Date: Sun, 20 Dec 1998 00:00
45 lines
3305 bytes
Trying to effectively implement JTable and JdbTable to display datasets from
JBCL.

One thing that I can't understand is how to easily control the columns I
wish to display when I use JdbTable. That darn constructor that uses the
dataset parameter does everything for you. It sets up all the columns, the
headers, the data model everything. When you try to modify the column model,
it seems to ignore changes like removeColumn and setWidth.

So, I have tried using the included swing data models that are provided to
work with the JBCL. I think the called them dbTable and dbTableColumn. These
are VERY poorly documented, if at all. I had good results using them with
JTable and JdbTable. However, no matter what I seem to do, I can't escape
this:

If I use JTable, I have total control over the column model and can display
any of the columns of the dataset I choose using dbTable as my underlying
interface to the JBCL dataset. However, absent JdbTable, there is no
tracking of the display table with the underlying dataset. But, IF I use
JdbTable to get the dataset to position itself on the row the user clicks
on, I cannot seem to control any of the column properties or characteristics
or drop any columns from table.

If there is no way, to control whatever columnModel that JdbTable
automatically creates for you when you use the setDataSet method, then it
seems that this implementation defeats the Model, ColumnModel, and View
architecture of JdbTable. But, how does it do this, did Borland override all
the methods in the column model and just turn them off in JdbTable ?

As far as I can tell, the Swing table is a pretty darn good control. The
JBCL GridControl is good as well. The JBCL control offers a lot of features
that are very useful and easy to implement. Controlling the visible columns,
and column widths however seems tough. Hence, I lean toward Swing. Because
if nice custom look and feel is what you want, Swing certainly has lots of
options. However, since I am displaying JBCL datasets, I next lean to
JdbTable, but once you get there, you lose all the flexibility. For now, I
am using JTable, and the dbTableModel and dbTableColumnModel that Borland
provides. It does an excellent job of displaying the JBCL datasets with the
only caveat being that the movements in the table aren't tracked by the
underlying dataset. I bet there is a listener or notification event I could
setup to use this.. and then, voila! You have JdbTable with the ability to
control the column properties! One can use JdbTable for quick and easy
solutions, but dbTableModel and dbTableColumnModel when more control is
required. So, any tips on tracking having the dataset track my JTable,
dbTableModel, and dbTableColumnModel implementation would be welcome.
Technical Details
Message-ID: <75i3vf$5ga1@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,51ccef507dd075d3,start
X-Google-Attributes: gid111d45,public
From: "Tommy Cox" <tommycox@ameasysoft.com>
Subject: Thoughts/questions/suggestions on JTable/JdbTable and the JBCL datasets
Date: 1998/12/20
Message-ID: <75i3vf$5ga1@forums.borland.com>
X-Deja-AN: 424134750
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.swing