views:

469

answers:

1

I'm trying to write an app that uses rounded corners for framing the app. I've found a package on google code that has a RoundedLinePanel and it seems to work... kind of.

I'm wondering a few things. Is this what people are using for creating divs with round corners in GWT? The release notes say it hasn't changed in almost a year.

Also, I can't seem to set a fixed height of this div (setHeight sets it on the wrapper div, not the inner one). so it's not useful to me as I have a fixed height app.

Finally, if anyone can suggest a better mechanism for creating rounded corner divs in GWT I'm all ears.

+1  A: 

There is a beautiful way to rounded corners using CSS 3 (which thus doesn't work in IE<=8 , but will in IE9 developer preview). Take a look at http://css3please.com/ to see the styles involved. It's fairly simple using a border-radius (or -moz-border-radius or -webkit-border-radius property). In GWT just add a Style Class Name you want to the elements you want to have a rounded border and you are go. Of course supporting rounded corners in legacy browsers is harder, but do you need to do it?

For legacy browsers it is quite harder, depending on the actual context. It always involves images for the borders. You have to create images that mask the border of the box. What works is the trick described in this answer. To use this in GWT you can use either uibinder, htmlelement or you create your own widget. A broader explanation of the technique can also be found here.

Paul de Vrieze
In fact I'm currently using border-radius (moz/web equivalent) and the one gripe (in my office) is that it only works for Firefox/Webkit. So yes, I do need to do it.
brad