|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.ListAction
public class ListAction extends Object
Add an Action to a JList that can be invoked either by using the keyboard or a mouse. By default the Enter will will be used to invoke the Action from the keyboard although you can specify and KeyStroke you wish. A double click with the mouse will invoke the same Action. The Action can be reset at any time.
| Field Summary | |
|---|---|
private static KeyStroke |
ENTER
|
private KeyStroke |
keyStroke
|
private JList |
list
|
| Constructor Summary | |
ListAction(JList list, Action action)
|
|
ListAction(JList list, Action action, KeyStroke keyStroke)
|
|
| Method Summary | |
|---|---|
void
|
mouseClicked(MouseEvent e)
|
void
|
mouseEntered(MouseEvent e)
|
void
|
mouseExited(MouseEvent e)
|
void
|
mousePressed(MouseEvent e)
|
void
|
mouseReleased(MouseEvent e)
|
void
|
setAction(Action action)
|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private static final KeyStroke ENTER
private KeyStroke keyStroke
private JList list
| Constructor Detail |
|---|
public ListAction(JList list, Action action)
public ListAction(JList list, Action action, KeyStroke keyStroke)
| Method Detail |
|---|
public void mouseClicked(MouseEvent e)
public void mouseEntered(MouseEvent e)
public void mouseExited(MouseEvent e)
public void mousePressed(MouseEvent e)
public void mouseReleased(MouseEvent e)
public void setAction(Action action)
Groovy Documentation