I try to write blogs whenever I get spare time

Just to let you know what I am trying to learn and what I am doing now.

Add Ext-GWT (GXT) to your GWT project

If you are familiar with the Ext-JS library, then probably you have seen their marvelous widgets. If you want to use those widgets in your GWT project, there is a very simple way to do that. Follow these steps:

  • First, download the GXT library from here.
  • Create a GWT project as described in my previous article.
  • Add the following entry to you projects module xml file.(This xml file would be found in your source folder, named as "xyz.gwt.xml"):
    << rel="stylesheet" type="text/css" href="css/ext-all.css" >>
  • Add the following stylesheet to your host page (the main html file that would be found in your "public" folder inside the source folder).
    << link rel="stylesheet" type="text/css" href="css/ext-all.css" >>
  • The first line of the html file should be:
    << !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >>
  • Eclipse Configuration:
  • Add gxt.jar to the project. You would find this jar file inside the folder where you have unzipped the library previously.
    a. Right click on project name in 'Package Explorer'.
    b. Select 'Properties' from content menu.
    c. Select 'Java Build Path'.
    d. Select 'Libraries' tab.
    e. Add the gxt.jar either with 'Add JARs...' or 'Add External JARs...'.
  • Add GXT jar to launch configuration.
    a. Choose Run / Open Run Dialog.
    b. Select your appropriate launch configuration under 'Java Application'.
    c. Select the 'Classpath' tab.
    d. Add the gxt.jar to the classpath.

That's all. Now you can use those beautiful widgets of Ext-JS in your project.

0 comments:

Post a Comment