java - SWT - show multiple table items -
could me? have table in swt , want show table items table shows 1 item , others vertical scroll. want show everything, without scrolling. tried option swt_no_scroll not working. have method creates table , other populates creating new table item, they´re working good, problem shows first item , other scrolling.
my code is:
private void createtable(composite parent){ table = new table (parent, swt.border); tablecolumn tcfile = new tablecolumn(table, swt.left); tablecolumn tcstatus = new tablecolumn(table, swt.left); tcfile.settext("file"); tcstatus.settext("status"); tcfile.setwidth(500); tcstatus.setwidth(500); table.setvisible(true); table.setheadervisible(true); } private void populatetable(string file, string status){ tableitem item = new tableitem(table, swt.left); item.settext(new string[] { file, status}); } composite top = new composite(parent, swt.wrap); gridlayout layout = new gridlayout(); layout.marginheight = -5; layout.marginwidth = 0; top.setlayout(layout); composite banner = new composite(top, swt.wrap); banner.setlayoutdata(new griddata(griddata.fill, griddata.vertical_align_beginning, false, false)); layout = new gridlayout(); layout.marginheight = 0; layout.marginwidth = 10; layout.numcolumns = 5; banner.setlayout(layout); createtable(top);
you haven't specified layout data table
, try like:
griddata data = new griddata(swt.fill, swt.fill, true, true); table.setlayoutdata(data);
if don't have else setting dialog/window size may need specify table height hint:
griddata data = new griddata(swt.fill, swt.fill, true, true); data.heighthint = 200; // vertical size table table.setlayoutdata(data);
Comments
Post a Comment