PDA

View Full Version : Alingment in HorizontalPanel not work



Aristofanio
12 Feb 2010, 5:16 AM
alignment does not work. follows the code below.

That is BUG?!




HorizontalPanel hp = new HorizontalPanel();

hp.setBorders(true);
hp.setWidth(300);
hp.setTableWidth("100%");
hp.add(new Label("Aligned Center"));

TableData td = new TableData();
td.setHorizontalAlign(HorizontalAlignment.RIGHT);
hp.add(new Label("Aligned Right"), td);

RootPanel.get().add(hp);

sempervivo
20 Oct 2010, 5:41 AM
I have the same problem Did you find the solution ?

sven
20 Oct 2010, 5:46 AM
Works fine for me. First one is not centered because no alignment specfied:


HorizontalPanel hp = new HorizontalPanel();

hp.setBorders(true);
hp.setWidth(300);
hp.setTableWidth("100%");
TableData td2 = new TableData();
td2.setHorizontalAlign(HorizontalAlignment.CENTER);
hp.add(new Label("Aligned Center"), td2);

TableData td = new TableData();
td.setHorizontalAlign(HorizontalAlignment.RIGHT);
hp.add(new Label("Aligned Right"), td);

RootPanel.get().add(hp);