All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javajs.swing.JComponent Maven / Gradle / Ivy

package javajs.swing;

import javajs.awt.Container;

public abstract class JComponent extends Container {

  protected boolean autoScrolls;
  protected String actionCommand;
  protected Object actionListener;

  protected JComponent(String type) {
    super(type);
  }
  
  public void setAutoscrolls(boolean b) {
    autoScrolls = b;
  }
  
  /** 
   * Note that it will be the job of the JavaScript on the 
   * page to do with actionListener what is desired.
   * 
   * In javax.swing, these methods are in AbstractButton, but
   * this is better for javajs.swing, reducing the duplication
   * of JTextField's actionListener business. 
   * 
   * @param listener 
   * 
   */
  public void addActionListener(Object listener) {
    actionListener = listener;
  }

  public String getActionCommand() {
    return actionCommand;
  }

  public void setActionCommand(String actionCommand) {
    this.actionCommand = actionCommand;
  }



  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy