Example usage for com.google.gwt.gwtai.applet.util AppletUtil callback

List of usage examples for com.google.gwt.gwtai.applet.util AppletUtil callback

Introduction

In this page you can find the example usage for com.google.gwt.gwtai.applet.util AppletUtil callback.

Prototype

public static void callback(Applet applet, String callbackValue) 

Source Link

Document

The an easy one, everything is transfered as String anyway.

Usage

From source file:com.google.gwt.gwtai.demo.impl.CallbackAppletImpl.java

@Override
public void init() {
    JButton button = new JButton("Send msg");
    final JTextArea msgTextArea = new JTextArea("Callback test");

    button.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            String msg = msgTextArea.getText();

            AppletUtil.callback(CallbackAppletImpl.this, msg);
        }//from   ww  w .j ava2s.c om

    });

    setLayout(new BorderLayout());
    getContentPane().add(msgTextArea, BorderLayout.CENTER);
    getContentPane().add(button, BorderLayout.SOUTH);
}

From source file:com.google.gwt.gwtai.demo.impl.StopWatchAppletImpl.java

License:Apache License

public void init() {
    JPanel panelMain = new JPanel(new BorderLayout());

    JButton buttonLap = new JButton("Lap");
    buttonLap.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            startWatch();//from w  ww.j  av  a 2  s  . co  m
            AppletUtil.callback(StopWatchAppletImpl.this, _swLabel.getText());
        }

    });

    _swLabel = new StopWatchLabel();

    panelMain.add(_swLabel, BorderLayout.CENTER);
    panelMain.add(buttonLap, BorderLayout.SOUTH);

    panelMain.setBorder(BorderFactory.createTitledBorder("StopWatchApplet"));
    panelMain.setBackground(Color.WHITE);

    getContentPane().add(panelMain);
}