Text in panel border

20 views
Skip to first unread message

jj

unread,
Mar 16, 2007, 2:48:05 PM3/16/07
to Google Web Toolkit
hello,

Is it possible to add text to a the border of a panel?

I remember back in swing you were able to selected titled border and
type in the text for the border. Any functionality like that in GWT?

thanks,
jan

Reinier Zwitserloot

unread,
Mar 18, 2007, 4:41:51 AM3/18/07
to Google Web Toolkit
No; at least not directly. GWT borders are implemented using CSS. If
you check the usual CSS resources (like blooberry.com and many
others), you'll find that the only CSS options for borders are colour,
thickness, and style (dotted, dashed, full, etcetera). No options for
rounded corners, certainly no options for widgets or even just text in
the border.

However, have a look at some 'rounded corner' efforts - in effect
there's nothing stopping you from using the exact same strategy to
stuff text in a border. (instead of an empty div with a background
image of the corner or the top-line extended horizontally, for
example, you'd use a non-empty div, or an image of text, repeated,
depending on what kind of text we're talking about here).

Assuming you just want a 'titlebar' of sorts here, again, same tactic:
div above a div.

Now for the strength of GWT: If you bundle this code up in one class,
which extends Composite, you can from there on out use this new fresh
widget until the end of days. If you end up not using it in a project,
no worries, GWT is smart enough not to toss it into your javascript
code.

In fact, there are a number of 'extra widgets' efforts going on, such
as the gwt widget toolkit, the yui-ext libraries, and so much more.
Perhaps one of those has what you need. Good luck!

Reply all
Reply to author
Forward
0 new messages