static Action create ( Runnable command ) { Objects . requireNonNull ( command , "The command may not be null" ) ; return new AbstractAction ( ) { /** * Serial UID */ private static final long serialVersionUID = 8693271079128413874L ; @ Override public void actionPerformed ( ActionEvent e ) { command . run ( ) ; } } ; }
Create a new action that simply executes the given command