>> I found this article quite helpful when I had to wrestle with renderers
>> and
[quoted text clipped - 14 lines]
> columns, so that I could put anything I liked in any grid box. But I'd
> still like to use a table.
Okay, I see what you're trying to do now. I've never tried to do what you
want in a JTable myself; that would seem to be stretching the idea of a
JTable well beyond what it was designed to do.
It sounds to me like you just want the JTable so that it keeps the various
lists in very close proximity and minimizes the amount of screen real estate
you are using. That's a reasonable goal but I don't think a JTable is the
best way to do it.
If it were me, I'd be looking at the various layout managers and trying to
figure out a way to display this information in a form of some kind,
probably not too different from your GridLayout panel, although I tend to
prefer like BoxLayout myself.
But if you want to stay with a JTable approach, there is an extensive set of
JTable examples that explore many of the more advanced things you can do
with JTables. They were developed by Nobuo Tamemasa in the early days of
Swing. Some of the code is a bit dated now due to deprecation but there's
still a lot of neat things illustrated in the examples he (?) created. You
can find the source code here: http://www.physci.org/codes/tame/ (click on
the Source link in the index on the left.) The "EachRowEditor.java" and
"EachRowRenderer.java" examples may be especially useful for your purposes.
Your other option might be to find the source code for programs that display
this information as properties the way you described in your initial post
for this thread; maybe you can find the source for NetBeans. for example,
or, failing that, for something that renders similar information in a
similar way.
--
Rhino
Tony Burrows - 15 Mar 2006 15:31 GMT
..snip..
> If it were me, I'd be looking at the various layout managers and trying to
> figure out a way to display this information in a form of some kind,
[quoted text clipped - 15 lines]
> or, failing that, for something that renders similar information in a
> similar way.
Thanks for that. A quick look at the site was interesting. Don't really
know why I thought of tables first, except that there are two data
columns. I agree a lyout manager is probably the way to go.
Tony