🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Removing Selected rows in JTable

#1365
From: Delali Dzirasa
Date: Tue, 20 Jan 2004 16:00
32 lines
2031 bytes
> When you get a NullPointerException, you should check each of the
> variables and/or field in the expression to see how it is initialized.
> Looking at your code, I see nothing that assigns a value to the "table"
> field in your "TableRender" class.
>--
>Regards,
>
>John McGrath [TeamB]


This may be a silly question but doesn't this code handle that?

 Vector temp = new Vector();
 Points t1 = new Points("name1", "conv1", "stats1", "pd1", "state1","fmt1");
 Points t2 = new Points("name2", "conv2", "stats2", "pd2", "state2","fmt2");

temp.addElement(t1);
temp.addElement(t2);

myTable.update(temp);
JTable table = new JTable(myTable);


I know that the data is set into the model but this: "JTable table = new
JTable(myTable);" sets the assigns the value of the table correct?

When I run the GUI I see the data that it was initialized too in my
cunstructor.  Is there another way I need to set the "table" so that the
getSelectedRow function does not return null?


Delali
Technical Details
Message-ID: <400d50a7$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <400c0372@newsgroups.borland.com> <400c2d2b$1@newsgroups.borland.com> <400c3798$1@newsgroups.borland.com> <400c92ae@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,c6be5540fdc67be3
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-01-20 08:10:31 PST
From: "Delali Dzirasa" <Delali.Dzirasa@jhuapl.edu>
Newsgroups: borland.public.jbuilder.java.swing
References: <400c0372@newsgroups.borland.com> <400c2d2b$1@newsgroups.borland.com> <400c3798$1@newsgroups.borland.com> <400c92ae@newsgroups.borland.com>
Subject: Re: Removing Selected rows in JTable
Date: Tue, 20 Jan 2004 11:00:40 -0500
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 128.244.232.236
Message-ID: <400d50a7$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1074614439 128.244.232.236 (20 Jan 2004 08:00:39 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail