Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Christian Kaufhold Newsgroups: comp.lang.java.gui Subject: Re: Strange JTable issue in Sun's Java code Date: Thu, 19 Jan 2012 21:00:03 +0100 Organization: A noiseless patient Spider Lines: 21 Message-ID: <3b9mu8-5v.ln1@ucuri.chka.de> References: Injection-Info: mx04.eternal-september.org; posting-host="Cs37RwPqxdxW4hjGndqbyg"; logging-data="23956"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JoGvyZ8EKMmDm6MwUBqGC" User-Agent: tin/1.9.5-20091224 ("Lochruan") (UNIX) (Linux/3.1.0-1.2-desktop (x86_64)) Cancel-Lock: sha1:+Y/XFI4JJWX4Jc17K3qnVIUoYcg= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4970 Novice wrote: > public int deleteAllRows() { > > String METHOD_NAME = "deleteAllRows()"; //$NON-NLS-1$ > if (DEBUG) this.logger.entering(this.CLASS_NAME, METHOD_NAME); > > int rowCount = getRowCount(); > //FIXME: remove the next line > System.err.println("rowCount = " + rowCount); //temporary > > this.phraseList.removeAllElements(); > fireTableRowsDeleted(1, rowCount); Rows indices are zero-based on inclusive on both sides. So this must be if (rowCount > 0) fireTableRowsDeleted(0, rowCount -1);