More Tutorials| Bioinformatics| Open Source| Photoshop| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Building Suggestion Box Using GWT 
 

This example describes the Basics for building the suggestion box using GWT.

 

Building Suggestion Box Using GWT

                         

This example describes the Basics for building the suggestion box using GWT. The steps involved in Building the Suggestion box are described below:-
final Label label = new Label("Enter the text in Suggestion box")
Here we are declaring label.

MultiWordSuggestOracle oracle = new MultiWordSuggestOracle()
Here we are creating object of class MultiWordSuggestOracle .MultiWordSuggestOracle  is a class that returns suggestion based on the query.

oracle. add("Cat")
This methods adds a suggestion to the oracle.

Suggest Box box = new SuggestBox(oracle)
Creating Suggest box , A suggest is a text area which displays a pre-configured set of selections.

RootPanel.get().add(label)
By this method we are adding label to the rootpanel.Root panel is a panel to which all other widgets must  be added. it is not created directly.


SuggestBoxex.java


package org.yournamehere.client;
import com.google.gwt.user.client.ui.Label; 
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SuggestBox;

public class SuggestBoxex {
  final Label label = new Label("Enter the text in Suggestion box");
 public void onModuleLoad() {
   MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();  
   oracle.add("Cat");
   oracle.add("Dog");
   oracle.add("Horse");
   oracle.add("india");
   oracle.add("Canada");
   oracle.add("France");
   oracle.add("uk");
   oracle.add("Japan");
   oracle.add("Russia");
   
   SuggestBox box = new SuggestBox(oracle);
   RootPanel.get().add(label);
   RootPanel.get().add(box);
    };
    
}

Main.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<module>
  <inherits name="com.google.gwt.user.User"/>
  <entry-point class="org.yournamehere.client.SuggestBoxex"/>
  
</module>

Output of the program

Download source code

                         

» View all related tutorials
Related Tags: c xml file server data gwt vi using this ie example exam e il des trie from in ml m

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.