01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ActionFocusNextComponent.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.swing.actions;
09:
10: import java.awt.event.ActionEvent;
11: import javax.swing.AbstractAction;
12: import javax.swing.FocusManager;
13: import javax.swing.JComponent;
14:
15: public class ActionFocusNextComponent extends AbstractAction {
16: private static final long serialVersionUID = 2535887415382858089L;
17:
18: public ActionFocusNextComponent() {
19: super ();
20: }
21:
22: public void actionPerformed(ActionEvent event) {
23: if (null != event) {
24: JComponent source_component = (JComponent) event
25: .getSource();
26: if (null != source_component) {
27: FocusManager.getCurrentManager().focusNextComponent(
28: source_component);
29: }
30: }
31: }
32: }
|