Oh my... I have no idea about that one but now that you provided the link I hope you don't mind me throwing some 2 cents. There's been 6-7 years since I last touched Swing tables. Seems like the TableView is backed by a NodeTableModel. That one is a subclass of Swing's AbstractTableModel. For a dynamic table structure, I guess you need to call NodeTableModel.setProperties when you add/remove/change columns; I'm not sure you can use that on an already initialized table and whether or not it calls all the appropriate listeners (for example whether or not it calls AbstractTableModel.fireTableStructureChanged and if it does what happens with the selection & scroll). Or subclass the AbstractTableModel and fire the appropriate events as needed when the structure changes. Enough yapping, I'm sure you and others here are much more qualified.
George T. În vin., 2 iul. 2021 la 23:19, Tim Mullé <tmu...@gmail.com> a scris: > > Hi George, > > Actually, I’m trying to use a regular NetBeans Explorer TableView.. not > the JavaFX tableview. > > http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/view/TableView.html > > I also see some examples use OutlineView and remove the Node (first > column).. but I think TableView is what is more closer to our current > JTable implementation. > > - Tim > > On Jul 2, 2021, at 4:04 PM, Gheorghe TUDOSE <tudo....@gmail.com> wrote: > > For the second point, the TableView "where we can create new columns with > expressions behind it where it calculates values to display in the table" - > I take it it's a JavaFX TableView. > If that is the case, I personally wrap each object corresponding to a > table row into a JavaFX-specific class (a ViewModel if you like) that keeps > a Map<String, Property>. > The JavaFX ViewModel has some registerProperty(String propertyName, > Class<T> valueClass) method that makes the appropriate property and puts it > into the above-mentioned map. > HTH > > George Tudose > > >