Section 8.6. Cascading Style Sheets


8.6. Cascading Style Sheets

Figure 8 indicates that the TextBoxes have a thin border around them, and the Button's label uses a different font than other elements on the page. (OK, so a professional designer might frown at these choices' lack of aesthetic quality!) The CSS file that is linked to the HTML controls these visual aspects of the application. Here is the link tag in the HTML that connects to our CSS file.

 <link rel="stylesheet" type="text/css" href="gwttest.css" /> 

Your code can automatically reference GUI elements using the syntax gwt-Button or gwt-TextBox in the CSS file selectors, as in our file gwttest.css.

 .gwt-TextBox { border: thin solid black} .gwt-Button { font-family: Verdana, serif; font-size: 1.2em} 

You can also dynamically change the style attributes of a GUI element in Java code, as in the upcoming RpcStatus class.




Google Web Toolkit for Ajax
Google Web Toolkit GWT Java AJAX Programming: A step-by-step to Google Web Toolkit for creating Ajax applications fast
ISBN: 1847191002
EAN: 2147483647
Year: 2006
Pages: 29

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net