• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

Google Web Toolkit (GWT) 2.0 Application Development

January 25, 2011 //  by Krishna Srinivasan//  Leave a Comment

Using the HomePage instance in EntryPoint

To see the output of the created home page layout, we must add the HomePage instance in
the root panel at the entry point class.

Getting ready

Open the file MainEntryPoint.java.

How to do it…

    1. Remove all previous code from the method onModuleLoad:
    2. Create an instance of the HomePage class in this method:

 HomePage homePage =new HomePage();
 
    1. Add the homepage instance in the RootPanel:

 RootPanel.get().a dd(homePage);
 

How it works…

After adding the HomePage instance in the RootPanel, if we run the project, we will get the
following output:

EntryPoint

EntryPoint is an interface that allows a class to act as a module entry point. When a
module is loaded, each entry point class listed in the Main.gwt.xml file is instantiated and
its onModuleLoad method is called. When the host page is accessed by the browser, the
onModuleLoad function is called to display the first panels and widgets.

RootPanel

RootPanel corresponds to an HTML element on the host page. It can be used to add other
panels and widgets. A RootPanel is accessed by calling RootPanel.get(id), where id is
the value of the HTML ID attribute. The <body> element of the host page can be accessed by
calling RootPanel.get().


 RootPanels are never created directly. Instead, they are accessed via get().
 

Class and packages

The following table shows the class and its corresponding package

See also

  • The Creating the home page layout class recipe
  • The Adding the banner recipe
  • The Adding menus recipe
  • The Creating the left-hand sidebar recipe
  • The Creating the right-hand sidebar recipe
  • The Creating the main content panel recipe
  • The Creating the footer recipe

GWT Articles & Books

  • Google Web ToolKit(GWT)
  • History Management in GWT
  • GWT Books
  • GWT Official Site

Pages: Page 1 Page 2 Page 3 Page 4

Category: GWTTag: GWT 2

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Previous Post: « Google App Engine Java and GWT Application Development
Next Post: Using YUI to attach JavaScript event listeners »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

np.zeros

A Complete Guide To NumPy Functions in Python For Beginners

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact