babyblue
14 May 2009, 5:44 PM
Is there a GXT equivalent of com.google.gwt.user.client.ui.Image?
public void onModuleLoad() {
ContentPanel background = new ContentPanel();
background.setHeaderVisible(false);
background.setSize(900, 600);
background.setPosition(0, 0);
background.add(new Image(IMAGE_PATH));
ContentPanel chart = new ContentPanel();
chart.setHeaderVisible(false);
chart.setSize(200, 200);
chart.setPosition(100, 100);
chart.add(getPieChart());
new Draggable(chart);
new Resizable(chart);
ContentPanel text = new ContentPanel();
text.setHeaderVisible(false);
text.setSize(200, 200);
text.setPosition(10, 50);
text.addText(TEXT);
new Draggable(text);
new Resizable(text);
LayoutContainer parent = new LayoutContainer();
parent.add(background);
parent.add(chart);
parent.add(text);
RootPanel.get().add(parent);
}
The desired effect is to have a background and 2 widgets floating on top of it. With out the background, the chart and text widgets are positioned correctly. But when background is added, everything get shifted to below the background. My guess is this is because Image is not gxt Component. Is there a GXT version of Image widget I can use?
Thanks in advance.
public void onModuleLoad() {
ContentPanel background = new ContentPanel();
background.setHeaderVisible(false);
background.setSize(900, 600);
background.setPosition(0, 0);
background.add(new Image(IMAGE_PATH));
ContentPanel chart = new ContentPanel();
chart.setHeaderVisible(false);
chart.setSize(200, 200);
chart.setPosition(100, 100);
chart.add(getPieChart());
new Draggable(chart);
new Resizable(chart);
ContentPanel text = new ContentPanel();
text.setHeaderVisible(false);
text.setSize(200, 200);
text.setPosition(10, 50);
text.addText(TEXT);
new Draggable(text);
new Resizable(text);
LayoutContainer parent = new LayoutContainer();
parent.add(background);
parent.add(chart);
parent.add(text);
RootPanel.get().add(parent);
}
The desired effect is to have a background and 2 widgets floating on top of it. With out the background, the chart and text widgets are positioned correctly. But when background is added, everything get shifted to below the background. My guess is this is because Image is not gxt Component. Is there a GXT version of Image widget I can use?
Thanks in advance.