[ xframe-Bugs-1169153 ] JXTable.setModel doesn't work.
"SourceForge.net" <[email protected]> Wed, 18 May 2005 17:13:14 -0700
| Newsgroups | gmane.text.xml.xframe.xsddoc |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1169153, was opened at 2005-03-23 16:04 Message generated for change (Settings changed) made by kriede You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=454391&aid=1169153&group_id=48863 Category: JXTable Group: swing-0.0.1 >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Kurt Riede (kriede) Summary: JXTable.setModel doesn't work. Initial Comment: Hi. If I do this: JXTable t1 = new JXTable(new TestModel(), 2); The table looks as expected. But if I do: JXTable t2 = new JXTable(); t2.setFrozenColumns(2); t2.setModel(new TestModel()); It shows a columless table. And if I do: JXTable t3 = new JXTable(); t3.setModel(new TestModel()); t3.setFrozenColumns(2); It simply crashes. Hope you can give me a hint because I really need this.Thanks. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-06 01:10 Message: Logged In: NO Found 1 more :) if you set t3 a new model (a second time) it works but it doesn't work with t1 so the following code: JXTable t1 = new JXTable(new TestModel(), 2); t1.setModel(new TestModel()); generates a java.lang.ArrayIndexOutOfBoundsException ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-05 19:49 Message: Logged In: NO Couldn't test it until now (was having troubles getting the latest from cvs) but now I have and it looks great. Don't see any problem this time. Thanks again! ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-04 18:11 Message: Logged In: NO Thanx again for your feedback and your consequent testing. The resizing problem was independent of the call to setModel and even occured in the simple case t1. I forgot to add a ColumnWidthChangeListener to the new or moved columns. Changes are checked in into CVS. Regards Kurt ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-04 17:33 Message: Logged In: NO One more: In t1 if you resize column 2 (the last in the frozenTable) everything works fine, but in t3, if you do the same, it just grows hidden inside the scrollTable. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-04 16:11 Message: Logged In: NO Thanks a lot! You are the man! BTW I had to get it from CVS since the zip is corrupted. Still t1 and t2 work nicely. ---------------------------------------------------------------------- Comment By: Kurt Riede (kriede) Date: 2005-04-02 23:10 Message: Logged In: YES user_id=484961 Sorry haven't seen the missing headers. A fix is committed to CVS. Attached is a zip file of the updated src folder. Regards Kurt ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-04-02 01:08 Message: Logged In: NO Makes sence. Just one thing... t2 and t3 have a slight problem: they don't show header. ---------------------------------------------------------------------- Comment By: Kurt Riede (kriede) Date: 2005-03-31 10:45 Message: Logged In: YES user_id=484961 Works as designed. The maximum value for frozenColumns is the number of available columns. Since in t2 there is no model yet (and thus no columns) setFrozenColumns(2) simple does nothing. In t3 you first set the model so you're able to setFrozenColumns(2). Regards Kurt ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-29 20:47 Message: Logged In: NO Sorry, t3 DOES work, only t2 freezes no column ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-29 20:33 Message: Logged In: NO Ok, with this new source code: 1. t1 still works ;) 2. t2 doesn't crash anymore, but no frozen columns. 3. same for t3 ---------------------------------------------------------------------- Comment By: Kurt Riede (kriede) Date: 2005-03-29 10:17 Message: Logged In: YES user_id=484961 Sorry, there are some more changes since the last release. I attached a zip file containing the whole src folder. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-28 22:15 Message: Logged In: NO Sorry, I just noticed now you had replied (the bug was never assigned). I just tried it but it doesn't compile, it's asking for new methods (getLockedHeader() and getScrollHeader()) in JXTableHeader as well as a different constructor. Will you attach that file as well or should I get a later release? Thanks. ---------------------------------------------------------------------- Comment By: Kurt Riede (kriede) Date: 2005-03-23 16:48 Message: Logged In: YES user_id=484961 Thank you for the bug report. I just checked in a new example that reproduces your bug: see class net.sf.xframe.swing.demo.JXTableDemo3 in the samples folder There is now also a fix for the bug: class net.sf.xframe.swing.JXTable The problem was that when setting a new tabel model, the column model wasn't properly adjusted to the new model. Should work now, but is not yet extensivly tested. Please give us feedback. The modified file JXTable.java is also attached to this report. Regards Kurt ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=454391&aid=1169153&group_id=48863 ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click