Hello I am having problems when using the Scala Swing library in version 2.8 Beta1-prerelease. I have a situation where I want to show a table in GUI, and update it as results are returned from a SQL request. Which way could this be done in Scala, at the moment i am using the DefaultTableModel from Java library.
Another thing is that I want the table to be sortable afterwards, I cant see if Scala swing library supports this either?
No – the scala swing library does not support sorting of
Table– your best best is to revert to usingJTable(i.e. the java swing class). A couple of things to note:Don’t use
DefaultTableModel– useAbstractTableModeland implement thegetSizeandgetValueAtmethods. A table model should follow the adapter patternThe appalling Java generics on the
RowSorterare annoying when used with scala. You will have to use explicit generic type arguments