java - TableView: one header with multiple columns -
i trying create table contains column 1 header has several entries per row in javafx 8. result should more or less this:
i tried add subcolumns works perfectly, not able hide headers of subcolums. found solutions hide header older versions of javafx , listview.
also tried add whole listview 1 row, similar suggested jewelsea here: javafx table- how add components?
of course used listview instead of button. tableview presents first entry of listview. here code callback class:
public class ielistviewcallback implements callback<tablecolumn<connectedielist, connectedielist>, tablecell<connectedielist, connectedielist>> { @override public tablecell<connectedielist, connectedielist> call(tablecolumn<connectedielist, connectedielist> param) { return new tablecell<connectedielist, connectedielist>() { final listview<string> listview = new listview<string>(); { listview.getitems().add("entry 1"); listview.getitems().add("entry 2"); listview.getitems().add("entry 3"); } @override public void updateitem(final connectedielist connectedielist, boolean empty) { super.updateitem(connectedielist, empty); setgraphic(listview); } }; } }
of course code testing. entries depend on commited list instead of being hard coded!
you can achieve explicitly setting height of sub-column 0 through css:
column.setstyle("-fx-pref-height: 0;")
you have sub-columns of column see effect.
Comments
Post a Comment