🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

JTable CellRenderer Quetion

#7676
From: James A. Schulz
Date: Sun, 24 Dec 2000 23:11
37 lines
1813 bytes
I have the following:

  public class MyCellRenderer extends DefaultTableCellRenderer {
    public MyCellRenderer(int align) {
      this.align = align;
    }
    protected void setValue(Object value) {
      super.setValue(value);
      setHorizontalAlignment(align);
    }
    protected int align;
  }


  JTable jTable1 = new JTable(new String[][]
{{"","","","","","","","","",""},

{"","","","","","","","","",""}},
                                            new String[]
{"","","","","","","","","",""});

  jTable1.setDefaultRenderer(null, new
MyCellRenderer(SwingConstants.CENTER));         //line 76

************

but the compiler complains about the last line saying:

"Applet1.java": Error #: 215 : invalid method declaration; return type
required at line 76, column 29
"Applet1.java": Error #: 203 : illegal start of type at line 76, column 30

What am I doing wrong?

thanks,

James
Technical Details
Message-ID: <925vkp$luo7@bornews.inprise.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,78ede608538ed371,start
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2000-12-24 15:09:09 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!not-for-mail
From: "James A. Schulz" <jaschulz@wiseware.com>
Newsgroups: borland.public.jbuilder.java.swing
Subject: JTable CellRenderer Quetion
Date: Sun, 24 Dec 2000 17:11:00 -0600
Organization: Another Netscape Collabra Server User
Lines: 39
Message-ID: <925vkp$luo7@bornews.inprise.com>
Reply-To: "James A. Schulz" <jaschulz@wiseware.com>
NNTP-Posting-Host: user-33qtc8u.dialup.mindspring.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200