Article View: borland.public.jbuilder.java.swing
Article #12739Re: JTable's column headers disappear --- bug?
From: Anne JANSSENS
Date: Tue, 10 Nov 1998 00:00
Date: Tue, 10 Nov 1998 00:00
22 lines
1388 bytes
1388 bytes
When you use a ScrollPane to hold your JTable, it is your scrollpane that is
in charge of showing the JTable's header,
if you use a JPanel to hold your JTable, you must say to your panel to show
the JTable in your case at the position north.
> private void jbInit() throws Exception
> {
> this.getContentPane().setLayout(borderLayout1);
> this.setSize(400,300);
> this.getContentPane().add(jScrollPane1, BorderLayout.CENTER);
> if (usePanel) {
> jPanel1.setLayout(borderLayout2);
> jPanel1.add(jTable1, BorderLayout.CENTER);
!!!!!!! JPanel1.add(JTable1.getTableHeader(),BorderLayout.NORTH);
> jScrollPane1.getViewport().add(jPanel1, null);
> }
> else {
> jScrollPane1.getViewport().add(jTable1, null);
> }
> }
I hope it will help you, Anne
Technical Details
Message-ID:
<729idb$3sf17@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<362514E3.8F63867A@paintedword.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,8dd026f36315022c X-Google-Attributes: gid111d45,public From: "Anne JANSSENS" <recherche@generix.fr> Subject: Re: JTable's column headers disappear --- bug? Date: 1998/11/10 Message-ID: <729idb$3sf17@forums.borland.com> X-Deja-AN: 410321624 References: <362514E3.8F63867A@paintedword.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing