javajs.swing.JComponent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmol Show documentation
Show all versions of jmol Show documentation
Jmol: an open-source Java viewer for chemical structures in 3D
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;
}
}