java - ScrolledComposite: scroll bar is not showing when needed -
i have ui looks below.
what i'm trying here initialize whole ui in beginning , call relayout()
method whenever user has filled input. problem here is, if content (the "name" here) takes more spaces, scroll bar supposed show , let user scroll can see data, scroll bar doesn't show @ all.
protected void initializeframe() { setlayout(new filllayout()); maincomposite = new composite(this, swt.none); maincomposite.setbackground(getbackground()); gridlayout layout = new gridlayout(2, false); maincomposite.setlayout(layout); griddata data = new griddata(); data.horizontalalignment = griddata.fill; data.grabexcesshorizontalspace = true; data.horizontalspan = 2; headingcomposite = new composite(maincomposite, swt.border); headingcomposite.setbackground(getbackground()); headingcomposite.setlayoutdata(data); scrolledcomposite = new scrolledcomposite(maincomposite, swt.v_scroll| swt.h_scroll); scrolledcomposite.getverticalbar().setincrement(10); scrolledcomposite.getverticalbar().setpageincrement(100); scrolledcomposite.gethorizontalbar().setincrement(10); scrolledcomposite.gethorizontalbar().setpageincrement(100); scrolledcomposite.setexpandhorizontal(true); scrolledcomposite.setexpandvertical(true); data = new griddata(griddata.fill_both ); data.widthhint = 500; scrolledcomposite.setlayoutdata(data); lefteditorcomposite = new composite(scrolledcomposite, swt.border); lefteditorcomposite.setbackground(getbackground()); scrolledcomposite.setcontent(lefteditorcomposite); data = new griddata(griddata.fill_both); data.widthhint = 150; righteditorcomposite = new composite(maincomposite, swt.border); righteditorcomposite.setbackground(getbackground()); righteditorcomposite.setlayoutdata(data); } public void relayout() { scrolledcomposite.setminsize(lefteditorcomposite.computesize(swt.default, swt.default)); }
can tell me wrong here?
Comments
Post a Comment