packAll() is really really slow ...

View: New views
3 Messages — Rating Filter:   Alert me  

packAll() is really really slow ...

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

i want to call the packAll() Method after i added my Data to the JXTable (about 9000 Objects), but when i call the method it needs round about 5 Minutes untill my GUI reacts ...

 - Is there a way to do this faster?
 - How about the Custom Filters? I think they will be also very slow for this data?!
[Message sent by forum member 'pms' (pms)]

http://forums.java.net/jive/thread.jspa?messageID=288025

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...


Re: packAll() is really really slow ...

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you instantiate your table with a custom ColumnFactory (else it may be a good time to start). You can override the ColumnFactory .getRowCount(JXTable table) method to return a smaller number of rows, say 1000. This is used during the packAll() and was exposed for exactly this kind of performance reason.

This does limit your packAll() to the first 1000 (or whatever) rows which doesn't necessarily guarantee the correct size for every row of course. I'd thought a random sampling might work better for some of my tables.. But it'll do the job.
[Message sent by forum member 'osbald' (osbald)]

http://forums.java.net/jive/thread.jspa?messageID=288028

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...


Re: packAll() is really really slow ...

by jdnc-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Hi there,
>
> i want to call the packAll() Method after i added my
> Data to the JXTable (about 9000 Objects), but when i
> call the method it needs round about 5 Minutes untill
> my GUI reacts ...
>
>  - Is there a way to do this faster?
> - How about the Custom Filters? I think they will be
> also very slow for this data?!

An alternative is to use prototypes on the columns instead of packAll.
TableColumnExt#setPrototypeValue(Object)
[Message sent by forum member 'rturnbull' (rturnbull)]

http://forums.java.net/jive/thread.jspa?messageID=288269

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@...
For additional commands, e-mail: jdnc-help@...

LightInTheBox - Buy quality products at wholesale price