🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

jdbTable header

#12914
From: Peter J Scott
Date: Mon, 19 Oct 1998 00:00
46 lines
1804 bytes
I think I am doing something stupid but I can't see it by reading the
documentation and the java tutorial.

I am trying to change the column headers from the database field names.

This is part of my code:

...
  MyTableModel myModel = new MyTableModel();
  JdbTable jdbTable1 = new JdbTable(myModel);

...

 class MyTableModel extends DefaultTableModel {
    final String[] columnNames = {"Product No.",
                                  "Product Type",
                                  "PAC",
                                  "GPAC1",
                                  "GPAC2",
                                  "GPAC3",
                                  "GPAC4"};
    public int getColumnCount(){
        return columnNames.length;
    }

    public String getColumnName(int col) {            
        return columnNames[col];    }  
 }

....

can anybody help. It compiles OK but when I run it I still get the field
names in the table header.

I've also tried:
jdbTable1.setModel(myModel)

thanks

Peter
  
-- 
Peter J Scott

Tel National:         01664 567186      Fax National:         0870 0569826
    International: +44 1664 567186          International: +44 870 0569826 
Technical Details
Message-ID: <WWro9HA1P6K2Ewyq@framland.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,e01f4c59ae216e23,start
X-Google-Attributes: gid111d45,public
From: Peter J Scott <peter@framland.demon.co.uk>
Subject: jdbTable header
Date: 1998/10/19
Message-ID: <WWro9HA1P6K2Ewyq@framland.demon.co.uk>
X-Deja-AN: 402937262
X-NNTP-Posting-Host: framland.demon.co.uk:194.222.31.244
X-Complaints-To: abuse@demon.net
X-Trace: news.demon.co.uk 908829797 nnrp-07:24668 NO-IDENT framland.demon.co.uk:194.222.31.244
Organization: naught
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing