Re: A better looking JTable

From: Paul Lutus (nospam_at_nosite.zzz)
Date: 09/15/04


Date: Tue, 14 Sep 2004 21:40:18 -0700

Rob W wrote:

> I want to create a JTable that emulates the appearance of native tables
> on Windows and OSX. In particular, if the panel that a table is in is
> taller than the size of the table (due to the table only having a few
> rows), I want the extra space in the table to be filled with empty
> cells, so that the table fills the whole panel.
>
> This behaviour is present in most native apps I've seen that use tables.
> A good example is the iTunes songs list.
>
> My specific scenario is that I have a table which may contain only 1
> row, or may contain as many as 50 (typically it contains 2 or 3 rows).x
>
> I want to display this table in a pane that is resizable.
>
> This means that the table may have a lot of extra veritcal space,
> relative to the rows being displayed. I want it to fill the unused,
> lower part of the pane with empty cells as the pane is made larger (and
> when it is first drawn).
>
> Is there a simple way to do this, or do I need to create a custom JTable
> class to paint the table as described?
>
> Any suggestions will be much appreciated.

Add empty rows to your table. Create a class that fills in the JTable to the
degree necessary to meet your requirement without actually creating
meaningless data in the original data set.

-- 
Paul Lutus
http://www.arachnoid.com


Relevant Pages

  • Re: A better looking JTable
    ... if the panel that a table is in is ... > I want to display this table in a pane that is resizable. ... > lower part of the pane with empty cells as the pane is made larger (and ... meaningless data in the original data set. ...
    (comp.lang.java.gui)
  • RE: Update panel with Gridview control
    ... You can send feedback directly to my manager at: ... Update panel with Gridview control ... Regarding on your new questions(deal with empty input parameter of the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Gluing wood to glass
    ... is attached to the panel. ... That trim is 1 3/4" wide and I believe its purpose ... seated into the sash with silicone. ... Grilles or other pane dividers can be attached with clips or is ...
    (rec.woodworking)
  • Re: Lost my window manager
    ... are supposed to be in the panel does nothing. ... Tht is why I set it to display no icons ... But if it was empty I would see the same blank spot at the top of the ... to know what the window manager is called or how to restore it. ...
    (Debian-User)
  • A better looking JTable
    ... if the panel that a table is in is ... I want to display this table in a pane that is resizable. ... lower part of the pane with empty cells as the pane is made larger (and ...
    (comp.lang.java.programmer)