...or you could use CSS and assign the css for the hyperlink to have a
single left (or right) or no border, e.g.

Hyperlink about = new Hyperlink("About us", "about");
Hyperlink register = new Hyperlink("Register", "register");
about.setStylePrimaryName("hyperlink-nosep");
register.setStylePrimaryName("hyperlink-leftsep");

then something like the following in CSS

.hyperlink-nosep{
   border-left:  0px;
}

.hyperlink-leftsep{
   border-left: solid 2px black;
}

should give you something like

About | Register

you can play with padding etc to get the separation between words as
you want.

//Adam

On 1 Maj, 12:12, hezjing <[email protected]> wrote:
> Hi
>
> I want to create a menu contains hyperlinks, and looks like "About us |
> Register | Login".
>
> Here is my code:
>
>         Hyperlink about = new Hyperlink("About us", "about");
>         Hyperlink register = new Hyperlink("Register", "register");
>         Hyperlink login = new Hyperlink("Login", "login");
>
>         // create a label to show the separator "|"
>         Label separator = new Label("|");
>         separator.addStyleName("menu");
>
>         HorizontalPanel menu = new HorizontalPanel();
>         menu.add(about);
>
>         // add the label "|" the 1st time
>         menu.add(separator);
>         menu.add(register);
>
>         // add the label "|" the 2nd time
>         menu.add(separator);
>         menu.add(login);
>
> The first label (or the separator) does not show up :-(
> It seems that we cannot add a same label more than once.
>
> The label does nothing but merely to show the separators, do we have other
> choice except to create a new label for every separator?
>
> --
>
> Hez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to