Benjamin Schwanke wrote:
I have a JTable (initial: 1 column, 0 rows) with a custom cell renderer and cell editor.
Rows are added dynamically. Each cell value is an Object that extends JPanel. Each panel has a close-button, which actionPerformed method calls getTableModel().removeRow(rowIdx).
I already tried some of the getModel().fireXXX() methods and many repaint/revalidate/setvisible(false/true() methods, but nothing happens. I even tried to remove all rows and add the leftover panels in new rows. But the view does not update automatically at all.
Benjamin Schwanke wrote:thank you for your advice.
In the first place I made it with JPanels and GridLayout. This is more or less perfect for performance and interaction. The only drawback was that I could not resize JPanels within a main frame.
Brian Cole wrote:
Benjamin Schwanke wrote:thank you for your advice.
In the first place I made it with JPanels and GridLayout. This is more or less perfect for performance and interaction. The only drawback was that I could not resize JPanels within a main frame.
I'm not sure what you mean here. I would think real panels would work better under resizing than JTable. How did JTable let you resize them? If you explain that, maybe I'll understand.
Brian Cole wrote:
If you mean that they shouldn't all be required to be the same height then, yes, GridLayout is no good for you. You could use BoxLayout or possibly even FlowLayout.
If you mean they shouldn't be stretched then you probably want to put the GridLayout panel in the North of a BorderLayout panel.
bacon. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|