🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to get Headers in a JTable

#12431
From: Anne JANSSENS
Date: Tue, 12 Jan 1999 00:00
30 lines
1586 bytes
>When you add a JTable in a container, you have to add the JTable's header :
>- if you're using a table without a scrollpane
>
>container.setLayout(new BorderLayout()); choose your own layout
>container.add(table.getTableHeader(),BorderLayout.NORTH);
>container.add(table,BorderLayout.CENTER);
>
>- if you're using a table in a scrollpane, you must force the header to be
>shown
>JScrollPane scrollpane=new JScrollPane(table);
>table.setPreferredScrollableViewportSize(new Dimension(500,70));
>scrollpane.setColumnHeaderView(table.getTableHeader());   <---------
>
>Hope it could help you :)Anne


Manuel K�gi a �crit dans le message <36962CE0.CE61806E@granitsoft.ch>...
>Hi
>
>can anybody tell me how I have to implement the AbstractTableModel that
>the JTable shows the Headers ?
>My Table alway shows only the datapart.
>I already overridden following functions :
>        getColumnCount, getRowCount, getValueAt, getColumnName,
>getColumnClass, isCellEditable, setValueAt
>
>Actually I don't get really what I have to return at getColumnClass.
>
>
>
Technical Details
Message-ID: <77fort$ptf10@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36962CE0.CE61806E@granitsoft.ch>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,c53d9c2a5d111107
X-Google-Attributes: gid111d45,public
From: "Anne JANSSENS" <recherche@generix.fr>
Subject: Re: How to get Headers in a JTable
Date: 1999/01/12
Message-ID: <77fort$ptf10@forums.borland.com>
X-Deja-AN: 431687327
References: <36962CE0.CE61806E@granitsoft.ch>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing