Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - Problems with JTable using fixed rows

 
Thread Tools Search this Thread
Old 11-05-2009, 03:55 AM   #11
Default Re: Problems with JTable using fixed rows


In article <hcsunv$u5s$03$>,
Michael Rauscher <> wrote:

> Felix Natter wrote:
> > Can you think of a way to get arounds this, like modifying the
> > validation order?

>
> If my theory is true, the following should work
>
> tblSP = new JScrollPane(dataTable) {
> public boolean isValidateRoot() {
> return false;
> }
> };


Indeed, it works perfectly in Noel's example. Thanks!

On review, I see that JRootPane, JScrollPane and JSplitPane all return
true for isValidateRoot(). In contrast, JTextField's isValidateRoot()
returns false when it's contained within a JViewport, perhaps for a
similar reason.

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>


John B. Matthews
  Reply With Quote
Old 11-05-2009, 07:49 PM   #12
Felix Natter
 
Posts: n/a
Default Re: Problems with JTable using fixed rows
"John B. Matthews" <> writes:

> In article <hcsunv$u5s$03$>,
> Michael Rauscher <> wrote:
>
>> Felix Natter wrote:
>> > Can you think of a way to get arounds this, like modifying the
>> > validation order?

>>
>> If my theory is true, the following should work
>>
>> tblSP = new JScrollPane(dataTable) {
>> public boolean isValidateRoot() {
>> return false;
>> }
>> };

>
> Indeed, it works perfectly in Noel's example. Thanks!


First of all thanks a lot for all the helpful replies, this
solution works perfectly

However, in order to make resizing columns work, the following is
necessary:
headerTable.setTableHeader(dataTable.getTableHeade r());
(I currently don't know why)

However, when using the above line, the sorting method provided
by Java 1.6 will not work any more. Luckily, the following solution
for java 1.5 works perfectly:
http://stackoverflow.com/questions/5...ws-in-java-1-5

Now everything works: column resizing, sorting, fixed rows, no update
problems

Thanks again!
--
Felix Natter


Felix Natter
  Reply With Quote
Old 11-06-2009, 05:18 AM   #13
Michael Rauscher
 
Posts: n/a
Default Re: Problems with JTable using fixed rows
Felix Natter wrote:
> "John B. Matthews" <> writes:
>
>> In article <hcsunv$u5s$03$>,
>> Michael Rauscher <> wrote:
>>> tblSP = new JScrollPane(dataTable) {
>>> public boolean isValidateRoot() {
>>> return false;
>>> }
>>> };

>> Indeed, it works perfectly in Noel's example. Thanks!


In fact, it works for your SSCCE, too.

> However, in order to make resizing columns work, the following is
> necessary:
> headerTable.setTableHeader(dataTable.getTableHeade r());
> (I currently don't know why)


If you apply it to your SSCCE, resizing and sorting will work as expected.

Bye
Michael


Michael Rauscher
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Massive computer problems...blue screens, restarts, beeping noises =?Utf-8?B?RXJpYw==?= Windows 64bit 39 01-26-2007 06:45 PM
connection problems after restore point dololly Computer Support 1 02-12-2006 08:05 PM
Problems with Games with 64 bit Don Whaley Windows 64bit 5 09-11-2005 08:12 PM
MS Office problems with updating and saving files across the network. Mark Acutt Computer Support 2 07-31-2003 02:50 PM
Re: windows 2000 sp4 is a must PhilGreg Computer Support 0 07-17-2003 04:38 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46