hi,
I'm green with GWT and this could be a silly question to do, but
friends I'm stuck with this issue for days.
I just need to two widgets, one in the left up corner and the other in
the right up corner. My problem is the widgets always appear together
in the up left corner. I've tried with different pannels and the same
thing.
Could somebody see where is my mistake?
HTML:
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<link type="text/css" rel="stylesheet" href="Test.css">
<title>Web Application Starter Project</title>
<script type="text/javascript" language="javascript" src="test/
test.nocache.js"></script>
</head>
<body>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'
style="position:absolute;width:0;height:0;border:0"></iframe>
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-
left: -11em; color: red; background-color: white; border: 1px solid
red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>
<div id="theTestId" class="box"/>
</body>
</html>
JAVA:
public void onModuleLoad() {
RootPanel root = RootPanel.get("theTestId");
HorizontalPanel panel1 = new HorizontalPanel();
HorizontalPanel panel2 = new HorizontalPanel();
panel1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
panel2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
Label label1 = new Label("left");
Label label2 = new Label("right");
label1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
label2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
panel1.add(label1);
panel2.add(label2);
DockPanel t = new DockPanel();
t.add(panel1, DockPanel.WEST);
t.add(panel2, DockPanel.EAST);
t.setCellHorizontalAlignment(panel1,
HasHorizontalAlignment.ALIGN_LEFT);
t.setCellHorizontalAlignment(panel2,
HasHorizontalAlignment.ALIGN_RIGHT);
root.add(t);
}
Thanks in advance for any help.
Iván
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.