🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

JTableHeader why not editable?

#951
From: ftirapelle
Date: Tue, 25 May 2004 20:09
25 lines
1595 bytes
Why is the JTableHeader not editable. I want to create an editable
JTableHeader but I cannot understand why if I use the
setHeaderRenderer method the header is not editable.
I have seen (http://www.esus.com/javaindex/j2se/jdk1.2/javaxswing/editableatomiccontrols/jtable/jtableeditableheader.html)
an example of editable JTableHeader. But why isn't enough the follow
code

....
TableColumnModel colModel = jTable1.getColumnModel();
for (int col = 0; col < jTable1.getColumnCount(); col++)
{
colModel.getColumn(col).setHeaderRenderer(new HeaderFilterRenderer());
}
.....
class HeaderFilterRenderer implements TableCellRenderer
{

public Component getTableCellRendererComponent(JTable table, Object
value,
boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) 
{
return new JTextField ();
}

}
Technical Details
Message-ID: <e16fe653.0405251209.6ca0a1c@posting.google.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,25eaa480b655c4b7,start
X-Google-Attributes: gid111d45,public
Path: arc1-ca.pugleaf.net!controlnews3.google.com!postnews1.google.com!not-for-mail
From: ftirapelle@yahoo.it (ftirapelle)
Newsgroups: borland.public.jbuilder.java.swing
Subject: JTableHeader why not editable?
Date: 25 May 2004 13:09:34 -0700
Organization: http://groups.google.com
Lines: 25
Message-ID: <e16fe653.0405251209.6ca0a1c@posting.google.com>
NNTP-Posting-Host: 212.171.134.68
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1085515774 6013 127.0.0.1 (25 May 2004 20:09:34 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 25 May 2004 20:09:34 +0000 (UTC)