I do the same thing with a seperate stylesheet file and it's working. Check
out the screenshot in the attachment. My code looks like this:

Inside grid.css:

   1. .db_icon
   2. {
   3.         background-image:
url(../js/ext/resources/icons/database.gif)!important;
   4.         padding-right: 5px;
   5.         margin: 0 !important;
   6. }


My module.gwt.xml file:

   1. <module>
   2.
   3.         <!– Inherit the core Web Toolkit stuff. –>
   4.         <inherits name=‘com.google.gwt.user.User’/>
   5.         <!– Inherit the GWTExt Toolkit library configuration. –>
   6.         <inherits name=‘com.gwtext.GwtExt’ />
   7.
   8.         <!– Set our own css file –>
   9.         <stylesheet src="css/grid.css" />
   10.
   11.         <!– Specify the app entry point class. –>
   12.         <entry-point class=‘org.mypackage.client.Main’/>
   13.
   14.         <stylesheet src="js/ext/resources/css/ext-all.css" />
   15.         <script src="js/ext/adapter/ext/ext-base.js" />
   16.         <script src="js/ext/ext-all.js" />
   17.
   18. </module>

And here the java snippet:


   1.       GridPanel grid = new GridPanel();
   2.       grid.setTitle( "Loading content from Database" );
   3.       grid.setStore( store );
   4.       grid.setColumnModel( columnModel );
   5.       grid.setFrame( true );
   6.       grid.setWidth( 440 );
   7.       grid.setHeight( 350 );
   8.       grid.stripeRows( true );
   9.       grid.setIconCls( "db_icon" );




Dariusz





On Thu, Apr 2, 2009 at 9:45 PM, Gabriel Ernesto Gutierrez Añez <gutierrez.ge
@gmail.com> wrote:

>
> as far as i know the setStyle() method is used to write directly on
> style attribute, you should use setCls()
>
> eg.
>
> btn.setStyle("width: 100px;")
>
> btn.setCls("labelStyle");
>
> regards,
>
> On 4/2/09, Neo <[email protected]> wrote:
> >
> > Hi,
> > Today was my first day with GWT Ext and quite obviously I ran into a
> > problem.
> > In my HelloWorld program I want to add CSS styling to a component. My
> > CSS file is named as "HelloWorld.css". I have added some style
> > information for a label:
> >
> > .labelStyle
> > {
> >       font-size:30;
> >       font-weight:normal;
> > }
> >
> > In my code I am doing this :
> > Label label = new Label("My Panel");
> > label.setStyle("labelStyle");
> >
> > In my HelloWorld.gwt.xml file I am doing this :
> > <!-- Specify the application specific style sheet.              -->
> > <stylesheet src="js/ext/resources/css/ext-all.css" />
> > <stylesheet src="HelloWorld.css" />
> >
> > However, the style information is not getting reflected in my
> > application. I am not really sure if I am doing this correct. Please
> > help me solve this issue.
> >
> > >
> >
>
>
> --
> _____________________
> Ing. Gabriel Gutiérrez
> Celular: +52 1 81 1071 7213
> Oficina: +52    81 8153 2415
> Monterrey, México
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" 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/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to