# Class JComponent

java.lang.Object
org.jmol.awtjs.swing.Component
org.jmol.awtjs.swing.Container
org.jmol.awtjs.swing.JComponent

Direct Known Subclasses:
  `AbstractButton, JContentPane, JEditorPane, JLabel, JPanel, JScrollPane, JSplitPane, JTable, JTextField, JTextPane`

public abstract class JComponent extends Container

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`actionCommand`
`protected Object`
`actionListener`
`protected boolean`
`autoScrolls`

### Fields inherited from class Container

`list`

### Fields inherited from class Component

`enabled, height, id, minHeight, minWidth, mouseListener, name, parent, renderHeight, renderWidth, text, width`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`JComponent(String type)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addActionListener(Object listener)`
Note that it will be the job of the JavaScript on the page to do with actionListener what is desired.
`String`
`getActionCommand()`
`void`
`setActionCommand(String actionCommand)`
`void`
`setAutoscrolls(boolean b)`

### Methods inherited from class Container

`add, addComponent, getComponent, getComponentCount, getComponents, getSubcomponentHeight, getSubcomponentWidth, insertComponent, remove, removeAll`

### Methods inherited from class Component

`addMouseListener, getCSSstyle, getHeight, getName, getParent, getText, getWidth, isEnabled, isVisible, newID, repaint, setBackground, setEnabled, setMinimumSize, setName, setParent, setPreferredSize, setText, setVisible, toHTML`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### autoScrolls

protected boolean autoScrolls

### actionCommand

protected String actionCommand

### actionListener

protected Object actionListener

## Constructor Details

### JComponent

protected JComponent(String type)

## Method Details

### setAutoscrolls

public void setAutoscrolls(boolean b)

### addActionListener

public void addActionListener(Object listener)
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 org.jmol.awtjs.swing, reducing the duplication of JTextField's actionListener business.

Parameters:
  `listener` -

### getActionCommand

public String getActionCommand()

### setActionCommand

public void setActionCommand(String actionCommand)