1 package javajs.swing;
\r
3 import javajs.awt.Container;
\r
5 public abstract class JComponent extends Container {
\r
7 protected boolean autoScrolls;
\r
8 protected String actionCommand;
\r
9 protected Object actionListener;
\r
11 protected JComponent(String type) {
\r
15 public void setAutoscrolls(boolean b) {
\r
20 * Note that it will be the job of the JavaScript on the
\r
21 * page to do with actionListener what is desired.
\r
23 * In javax.swing, these methods are in AbstractButton, but
\r
24 * this is better for javajs.swing, reducing the duplication
\r
25 * of JTextField's actionListener business.
\r
30 public void addActionListener(Object listener) {
\r
31 actionListener = listener;
\r
34 public String getActionCommand() {
\r
35 return actionCommand;
\r
38 public void setActionCommand(String actionCommand) {
\r
39 this.actionCommand = actionCommand;
\r