java - Creating Form in Center Screen in GWT/GXT? -


i using gxt 2.3.1 , want create form on center screen.

so used form example demo form example , centerlayout given in demo ext gwt explorer

but doesnt appear similar given in demo. neither in center.

can body explain this.??

my code

public class empdetails extends layoutcontainer {   private verticalpanel empvp; private formdata formdata;  public empdetails() {      formdata = new formdata("-20");      empvp = new verticalpanel();       empvp.setspacing(10);      createform();     setlayout(new centerlayout());     add(empvp); }   private void createform() {// textboxes , radio button demo example} 

output screen enter image description here

try horizontalalignment. table auto-generated gwt not having width 100% in case. set using css.

public empdetails() {      formdata = new formdata("-20");      empvp = new verticalpanel();      empvp.setstylename("toppanel");      empvp.setspacing(10);      createform();     empvp.sethorizontalalign(horizontalalignment.center);      add(empvp); } 

css:

.toppanel > table{     width:100%; } 

set style attribute formpanel if want title left aligned.

you can move separate style in css.

    formpanel simple = new formpanel();     ...     simple.setstyleattribute("text-align", "left"); 

note: follow java naming conventions.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -