eclipse - How to put label item on rowLayout in SWT? -
i want put items on row layout. take error. error image here:
my example code below:
gridlayout parentlayout = new gridlayout(1, true); parent.setlayout(parentlayout); // design filter composite layout composite filtercomposite = new composite(parent, swt.none); rowlayout filtercompositelayout = new rowlayout(); filtercompositelayout.wrap = true; filtercompositelayout.pack = false; filtercompositelayout.justify = true; filtercompositelayout.type = swt.horizontal; filtercomposite.setlayout(filtercompositelayout); // design filter composite label lbl_type = new label(filtercomposite, swt.border); lbl_type.settext("type :"); combo cmb_type = new combo(filtercomposite, swt.border); cmb_type.settext("-- choose --"); label lbl_severity = new label(filtercomposite, swt.border); lbl_severity.settext("severity :"); combo cmb_severity = new combo(filtercomposite, swt.border); cmb_severity.settext("-- choose --"); label lbl_startdate = new label(filtercomposite, swt.border); lbl_startdate.settext("start date : "); datetime datetimestart = new datetime(filtercomposite, swt.drop_down | swt.long); datetimestart.setlayoutdata(new griddata(swt.none, swt.none, true, true));
error on datatime row. can give advice? thank you.
you cant set griddata component placed in rowlayout. should use rowdata instead:
datetime datetimestart = new datetime(filtercomposite, swt.drop_down | swt.long); rowdata rd = new rowdata(); rd.width = 123; rd.height = 23; datetimestart.setlayoutdata(rd);
Comments
Post a Comment