mainentrypoint.java

来自「netbeans开发gwt程式的插件」· Java 代码 · 共 52 行

JAVA
52
字号
/*
 * MainEntryPoint.java
 *
 * Created on May 19, 2007, 5:46 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package my.company.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 *
 * @author sang
 */
public class MainEntryPoint implements EntryPoint {
   
    /** Creates a new instance of MainEntryPoint */
    public MainEntryPoint() {
    }
   
    /**
     * The entry point method, called automatically by loading a module
     * that declares an implementing class as an entry-point
     */
    public void onModuleLoad() {
        final Label label = new Label("Hello, GWT!!!");
        final Button button = new Button("Click me!");

        // The GWTServiceUsageExample is a VerticalPanel object, the constructor of
        //  which performs RPC operation with the server.
        GWTServiceUsageExample rpcCallingPanel = new GWTServiceUsageExample();
       
        button.addClickListener(new ClickListener(){
            public void onClick(Widget w) {
                label.setVisible(!label.isVisible());
            }
        });
       
        RootPanel.get().add(button);
        RootPanel.get().add(label);
        RootPanel.get().add(rpcCallingPanel);
    }
   
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?