TableListBox question


#1

I use my StringTableListBox class (inherited from TableListBox) to put in some MP3’s and their ID3 information. After the ID3 information has been scanned (this can take up to a few seconds), the table is the sorted according to the TableHeader’s last select column ID and sort direction.

Here’s where the problem arises: after the sorting, the table should reflect the new sort order:

  • If I call updateContent(), nothing happens. I guess this is because the number of rows did not change?
  • If I call repaint(), the changes are reflected - but another component on the screen, a TreeView, just disappears (it is “overpainted”)!

Why does the second option not work and why is the TreeView “overpainted”? What is the right way to do it?


#2

Yup. That can be quite annoying at times, but it is how the listbox works.

[quote]

  • If I call repaint(), the changes are reflected - but another component on the screen, a TreeView, just disappears (it is “overpainted”)!

Why does the second option not work and why is the TreeView “overpainted”? What is the right way to do it?[/quote]

Painting a list box would have no effect on a treeview unless you parked the list box on top of the treeview, and even then, if your listbox had suitable transparency to make this useful after the first paint, it’d continue to work after subsequent paints.

You’re doing something silly somewhere.

How are your components laid out? What is the hierarchy, and which things physically overlap? When you call repaint() are you callling it on the listbox or some parent container?


#3

Nothing overlaps, the components are laid out like this:

TreeView “Resizer” TableListBox

The “Resizer” is a component that may be positioned with the mouse and which resizes the width of the TreeView and TableListBox when being dragged.

All 3 components are part of MainComponent, which is the container for those 3 components. Nothing else is on the screen at the moment.


#4

Got it working, sort of. The problems arised, because I am filling the TableListBox from a separate Thread. This can lead to some problems.