theTuxRacer
theTuxRacer

Reputation: 13869

Ugly usage of hyperlink in GWT

The hyperlinks I was imagining is something like this as a header:

Foo | Bar | Baz

This is how I am doing it:

Hyperlink foo = new Hyperlink("Foo", "foo");
Hyperlink bar = new Hyperlink("Bar", "bar");
Label spacer = new Label(" | ");

header.add(statistics);
header.add(spacer);
header.add(admin);
RootPanel.get("headerDiv").add(header);

It still ends up looking like this (header is a horizontal panel, headerDiv is a Division on the html page):

Foo|Bar

without the whitespace. I googled a lot, but none seem to address what I am looking for. I also tried Anchors, but that was of no use either. Is there any elegant way of executing this?

Upvotes: 1

Views: 172

Answers (1)

Carlos Tasada
Carlos Tasada

Reputation: 4444

Take a look to the HorizontalPanel.setSpacing method I think it's what you're looking for.

Upvotes: 1

Related Questions