Article View: borland.public.jbuilder.java.swing
Article #1444Re: Column Headers Don't Show in Table
From: Gillmer J. Derge (TeamB)
Date: Thu, 20 Nov 2003 17:35
Date: Thu, 20 Nov 2003 17:35
29 lines
2246 bytes
2246 bytes
"Matthew Sweet" <matthew.sweet@sed.redstone.army.mil> wrote in message
news:3fbcf8fd@newsgroups.borland.com...
> agentTable.setToolTipText("");
> agentTable.setTableHeader(null);
> agentTable.setPreferredScrollableViewportSize(new
Dimension(50,
> 50));
> agentScrollPane.add(agentTable, null);
> agentScrollPane.setViewportView(agentTable);
> agentScrollPane.setAutoscrolls(true);
> agentScrollPane.setOpaque(true);
> agentScrollPane.setBounds(new Rectangle(24, 73, 315, 99));
> buildingAgentPanel.add(agentScrollPane, null);
The table headers are displayed by a separate component, and there are
two reasons why it isn't displaying (not sure why it shows in the
designer).
First, you're not adding the table header component to your UI. You
should probably add it as the scroll pane's column header.
agentScrollPane.setColumnView(agentTable.getTableHeader());
Second, you're setting the table header to null, so in this case there
isn't actually a table header to add to the scroll pane. You should
remove the line where you set the table header to null.
--
Gillmer J. Derge (TeamB)
Technical Details
Message-ID:
<3fbcfb74@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fbcf8fd@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,6f2d4b99ec92edf9 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2003-11-20 09:40:48 PST From: "Gillmer J. Derge \(TeamB\)" <spam@gillmerderge.com> Newsgroups: borland.public.jbuilder.java.swing References: <3fbcf8fd@newsgroups.borland.com> Subject: Re: Column Headers Don't Show in Table Date: Thu, 20 Nov 2003 12:35:49 -0500 Lines: 30 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 64.185.133.22 Message-ID: <3fbcfb74@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069349748 64.185.133.22 (20 Nov 2003 09:35:48 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail