Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Package Attributes
JSApplet Class Reference
Inheritance diagram for JSApplet:
Inheritance graph
[legend]
Collaboration diagram for JSApplet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void init ()
void destroy ()

Package Attributes

TextField text

Detailed Description

Definition at line 52 of file JSApplet.java.


Member Function Documentation

void JSApplet.destroy ( ) [inline]

Definition at line 93 of file JSApplet.java.

                             {
       }
void JSApplet.init ( ) [inline]

Definition at line 55 of file JSApplet.java.

                          {
              setLayout(new BorderLayout());     
              add(text = new TextField(), BorderLayout.CENTER);

              Panel panel = new Panel();
              add(panel, BorderLayout.SOUTH);

              // eval button.
              ActionListener evalListener = new ActionListener() {
                     JSObject window;
              
                     public void actionPerformed(ActionEvent e) {
                            if (window == null)
                                   window = JSObject.getWindow(JSApplet.this);
                            Object result = window.eval(text.getText());
                            if (result != null)
                                   System.out.println(result);
                            text.selectAll();
                     }
              };

              Button evalButton = new Button("eval");
              evalButton.addActionListener(evalListener);
              text.addActionListener(evalListener);
              panel.add(evalButton);

              // clear button.
              ActionListener clearConsoleListener = new ActionListener() {
                     public void actionPerformed(ActionEvent e) {
                            text.setText("");
                     }
              };

              Button clearConsole = new Button("clear");
              clearConsole.addActionListener(clearConsoleListener);
              panel.add(clearConsole);
       }

Here is the call graph for this function:


Member Data Documentation

TextField JSApplet.text [package]

Definition at line 53 of file JSApplet.java.


The documentation for this class was generated from the following file: