Groovy Documentation

com.wordpress.tipsforjava.swing
[Java] Class ListAction

java.lang.Object
  com.wordpress.tipsforjava.swing.ListAction
All Implemented Interfaces:
MouseListener

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.

Authors:
Rob Camick
Darryl Burke


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

ENTER

private static final KeyStroke ENTER


keyStroke

private KeyStroke keyStroke


list

private JList list


 
Constructor Detail

ListAction

public ListAction(JList list, Action action)


ListAction

public ListAction(JList list, Action action, KeyStroke keyStroke)


 
Method Detail

mouseClicked

public void mouseClicked(MouseEvent e)


mouseEntered

public void mouseEntered(MouseEvent e)


mouseExited

public void mouseExited(MouseEvent e)


mousePressed

public void mousePressed(MouseEvent e)


mouseReleased

public void mouseReleased(MouseEvent e)


setAction

public void setAction(Action action)


 

Groovy Documentation